OLD | NEW |
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/android/build_info.h" | 7 #include "base/android/build_info.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/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
13 #include "chrome/browser/android/chrome_media_client_android.h" | 13 #include "chrome/browser/android/chrome_media_client_android.h" |
14 #include "chrome/browser/android/seccomp_support_detector.h" | 14 #include "chrome/browser/android/seccomp_support_detector.h" |
15 #include "chrome/browser/google/google_search_counter_android.h" | |
16 #include "chrome/browser/signin/signin_manager_factory.h" | 15 #include "chrome/browser/signin/signin_manager_factory.h" |
17 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
18 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
19 #include "components/crash/app/breakpad_linux.h" | 18 #include "components/crash/app/breakpad_linux.h" |
20 #include "components/crash/browser/crash_dump_manager_android.h" | 19 #include "components/crash/browser/crash_dump_manager_android.h" |
21 #include "components/enhanced_bookmarks/persistent_image_store.h" | 20 #include "components/enhanced_bookmarks/persistent_image_store.h" |
22 #include "components/signin/core/browser/signin_manager.h" | 21 #include "components/signin/core/browser/signin_manager.h" |
23 #include "content/public/browser/android/compositor.h" | 22 #include "content/public/browser/android/compositor.h" |
24 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
25 #include "content/public/common/main_function_params.h" | 24 #include "content/public/common/main_function_params.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 74 } |
76 | 75 |
77 bool has_language_splits = | 76 bool has_language_splits = |
78 base::android::BuildInfo::GetInstance()->has_language_apk_splits(); | 77 base::android::BuildInfo::GetInstance()->has_language_apk_splits(); |
79 ui::SetLocalePaksStoredInApk(has_language_splits); | 78 ui::SetLocalePaksStoredInApk(has_language_splits); |
80 | 79 |
81 return ChromeBrowserMainParts::PreCreateThreads(); | 80 return ChromeBrowserMainParts::PreCreateThreads(); |
82 } | 81 } |
83 | 82 |
84 void ChromeBrowserMainPartsAndroid::PostProfileInit() { | 83 void ChromeBrowserMainPartsAndroid::PostProfileInit() { |
85 Profile* main_profile = profile(); | |
86 search_counter_.reset(new GoogleSearchCounterAndroid(main_profile)); | |
87 | |
88 ChromeBrowserMainParts::PostProfileInit(); | 84 ChromeBrowserMainParts::PostProfileInit(); |
89 | 85 |
90 // Previously we stored information related to salient images for bookmarks | 86 // Previously we stored information related to salient images for bookmarks |
91 // in a local file. We replaced the salient images with favicons. As part | 87 // in a local file. We replaced the salient images with favicons. As part |
92 // of the clean up, the local file needs to be deleted. See crbug.com/499415. | 88 // of the clean up, the local file needs to be deleted. See crbug.com/499415. |
93 base::FilePath bookmark_image_file_path = main_profile->GetPath().Append( | 89 base::FilePath bookmark_image_file_path = profile()->GetPath().Append( |
94 PersistentImageStore::kBookmarkImageStoreDb); | 90 PersistentImageStore::kBookmarkImageStoreDb); |
95 content::BrowserThread::PostDelayedTask( | 91 content::BrowserThread::PostDelayedTask( |
96 content::BrowserThread::FILE, FROM_HERE, | 92 content::BrowserThread::FILE, FROM_HERE, |
97 base::Bind(&DeleteFileTask, | 93 base::Bind(&DeleteFileTask, bookmark_image_file_path), |
98 bookmark_image_file_path), | |
99 base::TimeDelta::FromMinutes(1)); | 94 base::TimeDelta::FromMinutes(1)); |
100 } | 95 } |
101 | 96 |
102 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { | 97 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { |
103 TRACE_EVENT0("startup", | 98 TRACE_EVENT0("startup", |
104 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization") | 99 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization") |
105 net::NetworkChangeNotifier::SetFactory( | 100 net::NetworkChangeNotifier::SetFactory( |
106 new net::NetworkChangeNotifierFactoryAndroid()); | 101 new net::NetworkChangeNotifierFactoryAndroid()); |
107 | 102 |
108 content::Compositor::Initialize(); | 103 content::Compositor::Initialize(); |
(...skipping 29 matching lines...) Expand all Loading... |
138 ChromeBrowserMainParts::PostBrowserStart(); | 133 ChromeBrowserMainParts::PostBrowserStart(); |
139 | 134 |
140 content::BrowserThread::GetBlockingPool()->PostDelayedTask(FROM_HERE, | 135 content::BrowserThread::GetBlockingPool()->PostDelayedTask(FROM_HERE, |
141 base::Bind(&SeccompSupportDetector::StartDetection), | 136 base::Bind(&SeccompSupportDetector::StartDetection), |
142 base::TimeDelta::FromMinutes(1)); | 137 base::TimeDelta::FromMinutes(1)); |
143 } | 138 } |
144 | 139 |
145 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { | 140 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { |
146 NOTREACHED(); | 141 NOTREACHED(); |
147 } | 142 } |
OLD | NEW |