Chromium Code Reviews| Index: chrome/browser/chrome_browser_main_android.cc | 
| diff --git a/chrome/browser/chrome_browser_main_android.cc b/chrome/browser/chrome_browser_main_android.cc | 
| index 6617e4f27fee52472f19b19ab6e695d48a7e9969..0a09ef55aa332ae4240ae129cc934a13036952fc 100644 | 
| --- a/chrome/browser/chrome_browser_main_android.cc | 
| +++ b/chrome/browser/chrome_browser_main_android.cc | 
| @@ -13,6 +13,7 @@ | 
| #include "base/trace_event/trace_event.h" | 
| #include "chrome/browser/android/mojo/chrome_interface_registrar_android.h" | 
| #include "chrome/browser/android/seccomp_support_detector.h" | 
| +#include "chrome/browser/browser_process.h" | 
| #include "chrome/browser/signin/signin_manager_factory.h" | 
| #include "chrome/common/chrome_paths.h" | 
| #include "chrome/common/descriptors_android.h" | 
| @@ -24,9 +25,12 @@ | 
| #include "content/public/common/main_function_params.h" | 
| #include "net/android/network_change_notifier_factory_android.h" | 
| #include "net/base/network_change_notifier.h" | 
| +#include "ui/base/clipboard/clipboard_android.h" | 
| #include "ui/base/resource/resource_bundle_android.h" | 
| #include "ui/base/ui_base_paths.h" | 
| +class PrefService; | 
| + | 
| namespace { | 
| void DeleteFileTask( | 
| @@ -97,6 +101,17 @@ void ChromeBrowserMainPartsAndroid::PostProfileInit() { | 
| content::BrowserThread::FILE, FROM_HERE, | 
| base::Bind(&DeleteFileTask, bookmark_image_file_path), | 
| base::TimeDelta::FromMinutes(1)); | 
| + | 
| + // TODO(mpearson): Figure out if there's a better place for this. In | 
| + // short, we want ClipboardAndroid to get a call / be notified when a | 
| + // local_state pointer is available. | 
| + // Tell ClipboardAndroid that a local state pointer is available. | 
| + PrefService* local_state = g_browser_process->local_state(); | 
| + DCHECK(local_state != nullptr); | 
| 
 
Bernhard Bauer
2017/04/25 13:30:06
Nit: Just DCHECK(local_state).
 
Mark P
2017/04/25 18:51:21
Done.  Also removed TODO while I was here, as it s
 
 | 
| + // Given the context, the cast is guaranteed to succeed. | 
| + static_cast<ui::ClipboardAndroid*>(ui::Clipboard::GetForCurrentThread()) | 
| + ->SetLocalState(local_state); | 
| + | 
| // Start watching the preferences that need to be backed up backup using | 
| // Android backup, so that we create a new backup if they change. | 
| backup_watcher_.reset(new chrome::android::ChromeBackupWatcher(profile())); |