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/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.h" |
14 #include "chrome/browser/android/chrome_media_client_android.h" | 14 #include "chrome/browser/android/chrome_media_client_android.h" |
15 #include "chrome/browser/android/seccomp_support_detector.h" | 15 #include "chrome/browser/android/seccomp_support_detector.h" |
16 #include "chrome/browser/signin/signin_manager_factory.h" | 16 #include "chrome/browser/signin/signin_manager_factory.h" |
17 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
18 #include "components/crash/content/app/breakpad_linux.h" | 18 #include "components/crash/content/app/breakpad_linux.h" |
19 #include "components/crash/content/browser/crash_dump_manager_android.h" | 19 #include "components/crash/content/browser/crash_dump_manager_android.h" |
20 #include "components/signin/core/browser/signin_manager.h" | 20 #include "components/signin/core/browser/signin_manager.h" |
21 #include "content/public/browser/android/compositor.h" | 21 #include "content/public/browser/android/compositor.h" |
22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/common/main_function_params.h" | 23 #include "content/public/common/main_function_params.h" |
24 #include "media/base/android/media_client_android.h" | 24 #include "media/base/android/media_client_android.h" |
25 #include "net/android/network_change_notifier_factory_android.h" | 25 #include "net/android/network_change_notifier_factory_android.h" |
26 #include "net/base/network_change_notifier.h" | 26 #include "net/base/network_change_notifier.h" |
| 27 #include "ui/android/screen_android.h" |
27 #include "ui/base/resource/resource_bundle_android.h" | 28 #include "ui/base/resource/resource_bundle_android.h" |
28 #include "ui/base/ui_base_paths.h" | 29 #include "ui/base/ui_base_paths.h" |
| 30 #include "ui/gfx/screen.h" |
29 | 31 |
30 namespace { | 32 namespace { |
31 | 33 |
32 void DeleteFileTask( | 34 void DeleteFileTask( |
33 const base::FilePath& file_path) { | 35 const base::FilePath& file_path) { |
34 if (base::PathExists(file_path)) | 36 if (base::PathExists(file_path)) |
35 base::DeleteFile(file_path, false); | 37 base::DeleteFile(file_path, false); |
36 } | 38 } |
37 | 39 |
38 } // namespace | 40 } // namespace |
(...skipping 30 matching lines...) Expand all Loading... |
69 if (breakpad_enabled) { | 71 if (breakpad_enabled) { |
70 base::FilePath crash_dump_dir; | 72 base::FilePath crash_dump_dir; |
71 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir); | 73 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir); |
72 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir)); | 74 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir)); |
73 } | 75 } |
74 | 76 |
75 bool has_language_splits = | 77 bool has_language_splits = |
76 base::android::BuildInfo::GetInstance()->has_language_apk_splits(); | 78 base::android::BuildInfo::GetInstance()->has_language_apk_splits(); |
77 ui::SetLocalePaksStoredInApk(has_language_splits); | 79 ui::SetLocalePaksStoredInApk(has_language_splits); |
78 | 80 |
| 81 gfx::Screen::SetScreenInstance(ui::CreateScreenAndroid()); |
| 82 |
79 return ChromeBrowserMainParts::PreCreateThreads(); | 83 return ChromeBrowserMainParts::PreCreateThreads(); |
80 } | 84 } |
81 | 85 |
82 void ChromeBrowserMainPartsAndroid::PostProfileInit() { | 86 void ChromeBrowserMainPartsAndroid::PostProfileInit() { |
83 ChromeBrowserMainParts::PostProfileInit(); | 87 ChromeBrowserMainParts::PostProfileInit(); |
84 | 88 |
85 // Previously we stored information related to salient images for bookmarks | 89 // Previously we stored information related to salient images for bookmarks |
86 // in a local file. We replaced the salient images with favicons. As part | 90 // in a local file. We replaced the salient images with favicons. As part |
87 // of the clean up, the local file needs to be deleted. See crbug.com/499415. | 91 // of the clean up, the local file needs to be deleted. See crbug.com/499415. |
88 base::FilePath bookmark_image_file_path = | 92 base::FilePath bookmark_image_file_path = |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 ChromeBrowserMainParts::PostBrowserStart(); | 136 ChromeBrowserMainParts::PostBrowserStart(); |
133 | 137 |
134 content::BrowserThread::GetBlockingPool()->PostDelayedTask(FROM_HERE, | 138 content::BrowserThread::GetBlockingPool()->PostDelayedTask(FROM_HERE, |
135 base::Bind(&SeccompSupportDetector::StartDetection), | 139 base::Bind(&SeccompSupportDetector::StartDetection), |
136 base::TimeDelta::FromMinutes(1)); | 140 base::TimeDelta::FromMinutes(1)); |
137 } | 141 } |
138 | 142 |
139 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { | 143 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { |
140 NOTREACHED(); | 144 NOTREACHED(); |
141 } | 145 } |
OLD | NEW |