Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: chrome/browser/chrome_browser_main_android.cc

Issue 2832263002: Clipboard Android - Store and Read Last Modified Time from Prefs (Closed)
Patch Set: iadd missing files Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_browser_main_android.h" 5 #include "chrome/browser/chrome_browser_main_android.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/task_scheduler/post_task.h" 12 #include "base/task_scheduler/post_task.h"
13 #include "base/trace_event/trace_event.h" 13 #include "base/trace_event/trace_event.h"
14 #include "chrome/browser/android/mojo/chrome_interface_registrar_android.h" 14 #include "chrome/browser/android/mojo/chrome_interface_registrar_android.h"
15 #include "chrome/browser/android/preferences/clipboard_android.h"
15 #include "chrome/browser/android/seccomp_support_detector.h" 16 #include "chrome/browser/android/seccomp_support_detector.h"
17 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/signin/signin_manager_factory.h" 18 #include "chrome/browser/signin/signin_manager_factory.h"
17 #include "chrome/common/chrome_paths.h" 19 #include "chrome/common/chrome_paths.h"
18 #include "chrome/common/descriptors_android.h" 20 #include "chrome/common/descriptors_android.h"
19 #include "components/crash/content/app/breakpad_linux.h" 21 #include "components/crash/content/app/breakpad_linux.h"
20 #include "components/crash/content/browser/crash_dump_manager_android.h" 22 #include "components/crash/content/browser/crash_dump_manager_android.h"
21 #include "components/signin/core/browser/signin_manager.h" 23 #include "components/signin/core/browser/signin_manager.h"
22 #include "content/public/browser/android/compositor.h" 24 #include "content/public/browser/android/compositor.h"
23 #include "content/public/browser/browser_thread.h" 25 #include "content/public/browser/browser_thread.h"
24 #include "content/public/common/main_function_params.h" 26 #include "content/public/common/main_function_params.h"
25 #include "net/android/network_change_notifier_factory_android.h" 27 #include "net/android/network_change_notifier_factory_android.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 92
91 // Previously we stored information related to salient images for bookmarks 93 // Previously we stored information related to salient images for bookmarks
92 // in a local file. We replaced the salient images with favicons. As part 94 // in a local file. We replaced the salient images with favicons. As part
93 // of the clean up, the local file needs to be deleted. See crbug.com/499415. 95 // of the clean up, the local file needs to be deleted. See crbug.com/499415.
94 base::FilePath bookmark_image_file_path = 96 base::FilePath bookmark_image_file_path =
95 profile()->GetPath().Append("BookmarkImageAndUrlStore.db"); 97 profile()->GetPath().Append("BookmarkImageAndUrlStore.db");
96 content::BrowserThread::PostDelayedTask( 98 content::BrowserThread::PostDelayedTask(
97 content::BrowserThread::FILE, FROM_HERE, 99 content::BrowserThread::FILE, FROM_HERE,
98 base::Bind(&DeleteFileTask, bookmark_image_file_path), 100 base::Bind(&DeleteFileTask, bookmark_image_file_path),
99 base::TimeDelta::FromMinutes(1)); 101 base::TimeDelta::FromMinutes(1));
102
103 // Idempotent. Needs to be called once on startup. If
104 // InitializeClipboardAndroidFromLocalState() is called multiple times (e.g.,
105 // once per profile load), that's okay; the additional calls don't change
Bernhard Bauer 2017/04/27 09:27:17 Just for the sake of completeness: There aren't ac
Mark P 2017/04/27 19:25:59 Thanks for the remark. Did you want me to add tha
106 // anything.
107 android::InitClipboardAndroidFromLocalState(g_browser_process->local_state());
108
100 // Start watching the preferences that need to be backed up backup using 109 // Start watching the preferences that need to be backed up backup using
101 // Android backup, so that we create a new backup if they change. 110 // Android backup, so that we create a new backup if they change.
102 backup_watcher_.reset(new chrome::android::ChromeBackupWatcher(profile())); 111 backup_watcher_.reset(new chrome::android::ChromeBackupWatcher(profile()));
103 } 112 }
104 113
105 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { 114 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() {
106 TRACE_EVENT0("startup", 115 TRACE_EVENT0("startup",
107 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization") 116 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization")
108 net::NetworkChangeNotifier::SetFactory( 117 net::NetworkChangeNotifier::SetFactory(
109 new net::NetworkChangeNotifierFactoryAndroid()); 118 new net::NetworkChangeNotifierFactoryAndroid());
(...skipping 28 matching lines...) Expand all
138 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( 147 FROM_HERE, base::TaskTraits().MayBlock().WithPriority(
139 base::TaskPriority::BACKGROUND), 148 base::TaskPriority::BACKGROUND),
140 base::Bind(&ReportSeccompSupport), base::TimeDelta::FromMinutes(1)); 149 base::Bind(&ReportSeccompSupport), base::TimeDelta::FromMinutes(1));
141 150
142 RegisterChromeJavaMojoInterfaces(); 151 RegisterChromeJavaMojoInterfaces();
143 } 152 }
144 153
145 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { 154 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() {
146 NOTREACHED(); 155 NOTREACHED();
147 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698