@ -17,7 +17,7 @@ Completely remove contacts picker permission from the file dialog
chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java | 3
chrome/browser/BUILD.gn | 6
chrome/browser/android/bookmarks/bookmark_bridge.cc | 242 ++++++++++
chrome/browser/android/bookmarks/bookmark_bridge.h | 23
chrome/browser/android/bookmarks/bookmark_bridge.h | 24
chrome/browser/importer/profile_writer.cc | 12
chrome/browser/importer/profile_writer.h | 6
chrome/browser/ui/android/strings/android_chrome_strings.grd | 6
@ -29,11 +29,11 @@ Completely remove contacts picker permission from the file dialog
ui/shell_dialogs/select_file_dialog.h | 2
ui/shell_dialogs/select_file_dialog_android.cc | 6
ui/shell_dialogs/select_file_dialog_android.h | 2
23 files changed, 504 insertions(+), 14 deletions(-)
23 files changed, 505 insertions(+), 14 deletions(-)
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -38,7 +38 ,6 @@ by a child template that "extends" this
@@ -39,7 +39 ,6 @@ by a child template that "extends" this
{% endif %}
<uses-permission-sdk-23 android:name="android.permission.BLUETOOTH"/>
<uses-permission-sdk-23 android:name="android.permission.BLUETOOTH_ADMIN"/>
@ -182,9 +182,9 @@ Completely remove contacts picker permission from the file dialog
import android.text.TextUtils;
import android.util.Pair;
@@ -26,6 +32,11 @@ import org.chromium.components.url_forma
import org.chromium.components.url_formatter.UrlFormatter;
@@ -27,6 +33,11 @@ import org.chromium.components.url_forma
import org.chromium.content_public.browser.WebContents;
import org.chromium.url.GURL;
+import org.chromium.chrome.browser.document.ChromeLauncherActivity;
+import org.chromium.chrome.browser.IntentHandler;
@ -194,7 +194,7 @@ Completely remove contacts picker permission from the file dialog
import java.util.ArrayList;
import java.util.List;
@@ -586,6 +597 ,38 @@ public class BookmarkBridge {
@@ -587,6 +598 ,38 @@ public class BookmarkBridge {
}
/**
@ -233,7 +233,7 @@ Completely remove contacts picker permission from the file dialog
* Synchronously gets a list of bookmarks that match the specified search query.
* @param query Keyword used for searching bookmarks.
* @param maxNumberOfResult Maximum number of result to fetch.
@@ -1007,6 +105 0,24 @@ public class BookmarkBridge {
@@ -1017,6 +106 0,24 @@ public class BookmarkBridge {
depthList.add(depth);
}
@ -258,7 +258,7 @@ Completely remove contacts picker permission from the file dialog
private static List<Pair<Integer, Integer>> createPairsList(int[] left, int[] right) {
List<Pair<Integer, Integer>> pairList = new ArrayList<Pair<Integer, Integer>>();
for (int i = 0; i < left.length; i++) {
@@ -1074,6 +113 5,8 @@ public class BookmarkBridge {
@@ -1084,6 +114 5,8 @@ public class BookmarkBridge {
int getChildCount(long nativeBookmarkBridge, BookmarkBridge caller, long id, int type);
void getChildIDs(long nativeBookmarkBridge, BookmarkBridge caller, long id, int type,
List<BookmarkId> bookmarksList);
@ -288,7 +288,7 @@ Completely remove contacts picker permission from the file dialog
void closeSearchUI();
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
@@ -32,6 +32 ,7 @@ import org.chromium.components.browser_u
@@ -33,6 +33 ,7 @@ import org.chromium.components.browser_u
import org.chromium.components.browser_ui.widget.dragreorder.DragStateDelegate;
import org.chromium.components.browser_ui.widget.selectable_list.SelectableListLayout;
import org.chromium.components.browser_ui.widget.selectable_list.SelectableListToolbar.SearchDelegate;
@ -296,7 +296,7 @@ Completely remove contacts picker permission from the file dialog
import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate;
import org.chromium.components.favicon.LargeIconBridge;
import org.chromium.url.GURL;
@@ -54,6 +55 ,7 @@ public class BookmarkManager
@@ -55,6 +56 ,7 @@ public class BookmarkManager
private ComponentName mOpenBookmarkComponentName;
private ViewGroup mMainView;
private BookmarkModel mBookmarkModel;
@ -304,7 +304,7 @@ Completely remove contacts picker permission from the file dialog
private BookmarkUndoController mUndoController;
private final ObserverList<BookmarkUIObserver> mUIObservers = new ObserverList<>();
private BasicNativePage mNativePage;
@@ -328,6 +330 ,13 @@ public class BookmarkManager
@@ -329,6 +331 ,13 @@ public class BookmarkManager
}
/**
@ -318,7 +318,7 @@ Completely remove contacts picker permission from the file dialog
* @return Current URL representing the UI state of bookmark manager. If no state has been shown
* yet in this session, on phone return last used state stored in preference; on tablet
* return the url previously set by {@link #updateForUrl(String)}.
@@ -501,6 +510 ,16 @@ public class BookmarkManager
@@ -507,6 +516 ,16 @@ public class BookmarkManager
}
@Override
@ -374,7 +374,7 @@ Completely remove contacts picker permission from the file dialog
protected NativePage buildDownloadsPage(Tab tab) {
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -19 2,6 +19 2,8 @@ static_library("browser") {
@@ -203 ,6 +203 ,8 @@ static_library("browser") {
"bitmap_fetcher/bitmap_fetcher_service.h",
"bitmap_fetcher/bitmap_fetcher_service_factory.cc",
"bitmap_fetcher/bitmap_fetcher_service_factory.h",
@ -383,8 +383,8 @@ Completely remove contacts picker permission from the file dialog
"bluetooth/bluetooth_chooser_context.cc",
"bluetooth/bluetooth_chooser_context.h",
"bluetooth/bluetooth_chooser_context_factory.cc",
@@ -1865,6 +1867 ,8 @@ static_library("browser") {
"web_data_service_factory .h",
@@ -1910,6 +1912 ,8 @@ static_library("browser") {
"webapps/chrome_webapps_client .h",
"window_placement/window_placement_permission_context.cc",
"window_placement/window_placement_permission_context.h",
+ "importer/profile_writer.cc",
@ -392,7 +392,7 @@ Completely remove contacts picker permission from the file dialog
]
configs += [
@@ -3396,8 +3400 ,6 @@ static_library("browser") {
@@ -3468,8 +3472 ,6 @@ static_library("browser") {
"badging/badge_manager_factory.h",
"banners/app_banner_manager_desktop.cc",
"banners/app_banner_manager_desktop.h",
@ -504,7 +504,7 @@ Completely remove contacts picker permission from the file dialog
}
void BookmarkBridge::Destroy(JNIEnv*, const JavaParamRef<jobject>&) {
@@ -541,6 +614 ,175 @@ jint BookmarkBridge::GetTotalBookmarkCou
@@ -540,6 +613 ,175 @@ jint BookmarkBridge::GetTotalBookmarkCou
return count;
}
@ -682,16 +682,17 @@ Completely remove contacts picker permission from the file dialog
jlong id,
--- a/chrome/browser/android/bookmarks/bookmark_bridge.h
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.h
@@ -23,6 +23,8 @@
#include "components/bookmarks/browser/base_bookmark_model_observer.h"
#include "components/bookmarks/common/android/bookmark_id.h"
@@ -25,6 +25,9 @@
#include "components/prefs/pref_change_registrar.h"
#include "url/android/gurl_android.h"
+#include "components/search_engines/template_url.h"
+#include "ui/shell_dialogs/select_file_dialog.h"
+
namespace bookmarks {
class BookmarkModel;
@@ -38,7 +40,8 @@ class Profile;
class ManagedBookmarkService;
@@ -39,7 +42,8 @@ class Profile;
class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
public PartnerBookmarksShim::Observer,
public ReadingListManager::Observer,
@ -701,7 +702,7 @@ Completely remove contacts picker permission from the file dialog
public:
BookmarkBridge(JNIEnv* env,
const base::android::JavaRef<jobject>& obj,
@@ -54,6 +57 ,12 @@ class BookmarkBridge : public bookmarks:
@@ -55,6 +59 ,12 @@ class BookmarkBridge : public bookmarks:
bool IsDoingExtensiveChanges(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
@ -714,7 +715,7 @@ Completely remove contacts picker permission from the file dialog
jboolean IsEditBookmarksEnabled(JNIEnv* env);
void LoadEmptyPartnerBookmarkShimForTesting(
@@ -141,6 +150 ,13 @@ class BookmarkBridge : public bookmarks:
@@ -142,6 +152 ,13 @@ class BookmarkBridge : public bookmarks:
jlong id,
jint type);
@ -728,7 +729,7 @@ Completely remove contacts picker permission from the file dialog
void SetBookmarkTitle(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
jlong id,
@@ -311,12 +327 ,14 @@ class BookmarkBridge : public bookmarks:
@@ -315,12 +332 ,14 @@ class BookmarkBridge : public bookmarks:
void DestroyJavaObject();
Profile* profile_;
@ -743,7 +744,7 @@ Completely remove contacts picker permission from the file dialog
// Information about the Partner bookmarks (must check for IsLoaded()).
// This is owned by profile.
@@ -328,6 +346 ,9 @@ class BookmarkBridge : public bookmarks:
@@ -332,6 +351 ,9 @@ class BookmarkBridge : public bookmarks:
// Observes the profile destruction and creation.
ScopedObserver<Profile, ProfileObserver> profile_observer_{this};
@ -826,7 +827,7 @@ Completely remove contacts picker permission from the file dialog
</message>
--- a/chrome/common/BUILD.gn
+++ b/chrome/common/BUILD.gn
@@ -401,6 +401 ,9 @@ static_library("common") {
@@ -403,6 +403 ,9 @@ static_library("common") {
sources += [
"media/chrome_media_drm_bridge_client.cc",
"media/chrome_media_drm_bridge_client.h",
@ -834,11 +835,11 @@ Completely remove contacts picker permission from the file dialog
+ "importer/imported_bookmark_entry.cc",
+ "importer/imported_bookmark_entry.h",
]
} else {
# Non-Android.
public_deps += [ "//chrome/common/importer" ]
--- a/chrome/utility/BUILD.gn
+++ b/chrome/utility/BUILD.gn
@@ -71,8 +71 ,6 @@ static_library("utility") {
@@ -73,8 +73 ,6 @@ static_library("utility") {
if (!is_android) {
sources += [
@ -847,7 +848,7 @@ Completely remove contacts picker permission from the file dialog
"importer/bookmarks_file_importer.cc",
"importer/bookmarks_file_importer.h",
"importer/external_process_importer_bridge.cc",
@@ -187,6 +185 ,11 @@ static_library("utility") {
@@ -191,6 +189 ,11 @@ static_library("utility") {
}
}
@ -959,7 +960,7 @@ Completely remove contacts picker permission from the file dialog
// than true bookmarks.
--- a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
+++ b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
@@ -38,6 +38 ,7 @@ import org.chromium.base.task.AsyncTask;
@@ -35,6 +35 ,7 @@ import org.chromium.base.task.AsyncTask;
import org.chromium.base.task.PostTask;
import org.chromium.base.task.TaskTraits;
import org.chromium.ui.R;
@ -967,15 +968,15 @@ Completely remove contacts picker permission from the file dialog
import org.chromium.ui.UiUtils;
import java.io.File;
@@ -58,6 +59 ,7 @@ public class SelectFileDialog implements
@@ -53,6 +54 ,7 @@ public class SelectFileDialog implements
private static final String TAG = "SelectFileDialog";
private static final String IMAGE_TYPE = "image";
private static final String VIDEO_TYPE = "video";
+ private static final String HTML_TYPE = "text ";
+ private static final String HTML_TYPE = "html ";
private static final String AUDIO_TYPE = "audio";
private static final String ALL_TYPES = "*/*";
@@ -149,6 +151 ,11 @@ public class SelectFileDialog implements
@@ -143,6 +145 ,11 @@ public class SelectFileDialog implements
mFileTypes = fileTypes;
}
@ -987,7 +988,7 @@ Completely remove contacts picker permission from the file dialog
/**
* Creates and starts an intent based on the passed fileTypes and capture value.
* @param fileTypes MIME types requested (i.e. "image/*")
@@ -177,7 +184 ,7 @@ public class SelectFileDialog implements
@@ -170,7 +177 ,7 @@ public class SelectFileDialog implements
List<String> missingPermissions = new ArrayList<>();
String storagePermission = Manifest.permission.READ_EXTERNAL_STORAGE;
boolean shouldUsePhotoPicker = shouldUsePhotoPicker();
@ -996,7 +997,7 @@ Completely remove contacts picker permission from the file dialog
if (!window.hasPermission(storagePermission)) missingPermissions.add(storagePermission);
} else {
if (((mSupportsImageCapture && shouldShowImageTypes())
@@ -205,7 +212 ,7 @@ public class SelectFileDialog implements
@@ -198,7 +205 ,7 @@ public class SelectFileDialog implements
}
// TODO(finnur): Remove once we figure out the cause of crbug.com/950024.
@ -1005,7 +1006,7 @@ Completely remove contacts picker permission from the file dialog
if (permissions.length != requestPermissions.length) {
throw new RuntimeException(
String.format("Permissions arrays misaligned: %d != %d",
@@ -219,7 +226 ,7 @@ public class SelectFileDialog implements
@@ -212,7 +219 ,7 @@ public class SelectFileDialog implements
}
}
@ -1014,7 +1015,7 @@ Completely remove contacts picker permission from the file dialog
onFileNotSelected();
return;
}
@@ -385,6 +392 ,7 @@ public class SelectFileDialog implements
@@ -358,6 +365 ,7 @@ public class SelectFileDialog implements
}
if (!mimeTypes.contains(mimeType)) mimeTypes.add(mimeType);
}
@ -1022,7 +1023,7 @@ Completely remove contacts picker permission from the file dialog
return mimeTypes;
}
@@ -686,6 +694 ,10 @@ public class SelectFileDialog implements
@@ -659,6 +667 ,10 @@ public class SelectFileDialog implements
return countAcceptTypesFor(superType) == mFileTypes.size();
}
@ -1046,7 +1047,7 @@ Completely remove contacts picker permission from the file dialog
--- a/ui/shell_dialogs/select_file_dialog_android.cc
+++ b/ui/shell_dialogs/select_file_dialog_android.cc
@@ -144,6 +144 ,12 @@ void SelectFileDialogImpl::SelectFileImp
@@ -140,6 +140 ,12 @@ void SelectFileDialogImpl::SelectFileImp
owning_window->GetJavaObject());
}