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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 } // namespace | 38 } // namespace |
39 | 39 |
40 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( | 40 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( |
41 const content::MainFunctionParams& parameters) | 41 const content::MainFunctionParams& parameters) |
42 : ChromeBrowserMainParts(parameters) { | 42 : ChromeBrowserMainParts(parameters) { |
43 } | 43 } |
44 | 44 |
45 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { | 45 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { |
46 } | 46 } |
47 | 47 |
48 int ChromeBrowserMainPartsAndroid::PreCreateThreads() { | 48 int ChromeBrowserMainPartsAndroid::PreCreateThreadsBegin() { |
49 TRACE_EVENT0("startup", "ChromeBrowserMainPartsAndroid::PreCreateThreads") | 49 TRACE_EVENT0("startup", |
| 50 "ChromeBrowserMainPartsAndroid::PreCreateThreadsBegin") |
50 | 51 |
51 // The CrashDumpManager must be initialized before any child process is | 52 // The CrashDumpManager must be initialized before any child process is |
52 // created (as they need to access it during creation). Such processes | 53 // created (as they need to access it during creation). Such processes |
53 // are created on the PROCESS_LAUNCHER thread, and so the manager is | 54 // are created on the PROCESS_LAUNCHER thread, and so the manager is |
54 // initialized before that thread is created. | 55 // initialized before that thread is created. |
55 #if defined(GOOGLE_CHROME_BUILD) | 56 #if defined(GOOGLE_CHROME_BUILD) |
56 // TODO(jcivelli): we should not initialize the crash-reporter when it was not | 57 // TODO(jcivelli): we should not initialize the crash-reporter when it was not |
57 // enabled. Right now if it is disabled we still generate the minidumps but we | 58 // enabled. Right now if it is disabled we still generate the minidumps but we |
58 // do not upload them. | 59 // do not upload them. |
59 bool breakpad_enabled = true; | 60 bool breakpad_enabled = true; |
60 #else | 61 #else |
61 bool breakpad_enabled = false; | 62 bool breakpad_enabled = false; |
62 #endif | 63 #endif |
63 | 64 |
64 // Allow Breakpad to be enabled in Chromium builds for testing purposes. | 65 // Allow Breakpad to be enabled in Chromium builds for testing purposes. |
65 if (!breakpad_enabled) | 66 if (!breakpad_enabled) |
66 breakpad_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( | 67 breakpad_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
67 switches::kEnableCrashReporterForTesting); | 68 switches::kEnableCrashReporterForTesting); |
68 | 69 |
69 if (breakpad_enabled) { | 70 if (breakpad_enabled) { |
70 base::FilePath crash_dump_dir; | 71 base::FilePath crash_dump_dir; |
71 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir); | 72 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir); |
72 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir)); | 73 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir)); |
73 } | 74 } |
74 | 75 |
75 bool has_language_splits = | 76 bool has_language_splits = |
76 base::android::BuildInfo::GetInstance()->has_language_apk_splits(); | 77 base::android::BuildInfo::GetInstance()->has_language_apk_splits(); |
77 ui::SetLocalePaksStoredInApk(has_language_splits); | 78 ui::SetLocalePaksStoredInApk(has_language_splits); |
78 | 79 |
79 return ChromeBrowserMainParts::PreCreateThreads(); | 80 return ChromeBrowserMainParts::PreCreateThreadsBegin(); |
80 } | 81 } |
81 | 82 |
82 void ChromeBrowserMainPartsAndroid::PostProfileInit() { | 83 void ChromeBrowserMainPartsAndroid::PostProfileInit() { |
83 ChromeBrowserMainParts::PostProfileInit(); | 84 ChromeBrowserMainParts::PostProfileInit(); |
84 | 85 |
85 // Previously we stored information related to salient images for bookmarks | 86 // Previously we stored information related to salient images for bookmarks |
86 // 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 |
87 // 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. |
88 base::FilePath bookmark_image_file_path = | 89 base::FilePath bookmark_image_file_path = |
89 profile()->GetPath().Append("BookmarkImageAndUrlStore.db"); | 90 profile()->GetPath().Append("BookmarkImageAndUrlStore.db"); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 ChromeBrowserMainParts::PostBrowserStart(); | 133 ChromeBrowserMainParts::PostBrowserStart(); |
133 | 134 |
134 content::BrowserThread::GetBlockingPool()->PostDelayedTask(FROM_HERE, | 135 content::BrowserThread::GetBlockingPool()->PostDelayedTask(FROM_HERE, |
135 base::Bind(&SeccompSupportDetector::StartDetection), | 136 base::Bind(&SeccompSupportDetector::StartDetection), |
136 base::TimeDelta::FromMinutes(1)); | 137 base::TimeDelta::FromMinutes(1)); |
137 } | 138 } |
138 | 139 |
139 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { | 140 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { |
140 NOTREACHED(); | 141 NOTREACHED(); |
141 } | 142 } |
OLD | NEW |