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