| 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/enhanced_bookmarks/persistent_image_store.h" | 20 #include "components/enhanced_bookmarks/persistent_image_store.h" |
| 21 #include "components/signin/core/browser/signin_manager.h" | 21 #include "components/signin/core/browser/signin_manager.h" |
| 22 #include "content/public/browser/android/compositor.h" |
| 22 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
| 23 #include "content/public/common/main_function_params.h" | 24 #include "content/public/common/main_function_params.h" |
| 24 #include "media/base/android/media_client_android.h" | 25 #include "media/base/android/media_client_android.h" |
| 25 #include "net/android/network_change_notifier_factory_android.h" | 26 #include "net/android/network_change_notifier_factory_android.h" |
| 26 #include "net/base/network_change_notifier.h" | 27 #include "net/base/network_change_notifier.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" |
| 29 | 30 |
| 30 #if !defined(USE_AURA) | |
| 31 #include "content/public/browser/android/compositor.h" | |
| 32 #endif | |
| 33 | |
| 34 namespace { | 31 namespace { |
| 35 | 32 |
| 36 void DeleteFileTask( | 33 void DeleteFileTask( |
| 37 const base::FilePath& file_path) { | 34 const base::FilePath& file_path) { |
| 38 if (base::PathExists(file_path)) | 35 if (base::PathExists(file_path)) |
| 39 base::DeleteFile(file_path, false); | 36 base::DeleteFile(file_path, false); |
| 40 } | 37 } |
| 41 | 38 |
| 42 } // namespace | 39 } // namespace |
| 43 | 40 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 base::Bind(&DeleteFileTask, bookmark_image_file_path), | 93 base::Bind(&DeleteFileTask, bookmark_image_file_path), |
| 97 base::TimeDelta::FromMinutes(1)); | 94 base::TimeDelta::FromMinutes(1)); |
| 98 } | 95 } |
| 99 | 96 |
| 100 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { | 97 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { |
| 101 TRACE_EVENT0("startup", | 98 TRACE_EVENT0("startup", |
| 102 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization") | 99 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization") |
| 103 net::NetworkChangeNotifier::SetFactory( | 100 net::NetworkChangeNotifier::SetFactory( |
| 104 new net::NetworkChangeNotifierFactoryAndroid()); | 101 new net::NetworkChangeNotifierFactoryAndroid()); |
| 105 | 102 |
| 106 #if !defined(USE_AURA) | |
| 107 content::Compositor::Initialize(); | 103 content::Compositor::Initialize(); |
| 108 #endif | |
| 109 | 104 |
| 110 // Chrome on Android does not use default MessageLoop. It has its own | 105 // Chrome on Android does not use default MessageLoop. It has its own |
| 111 // Android specific MessageLoop. | 106 // Android specific MessageLoop. |
| 112 DCHECK(!main_message_loop_.get()); | 107 DCHECK(!main_message_loop_.get()); |
| 113 | 108 |
| 114 // Create and start the MessageLoop. | 109 // Create and start the MessageLoop. |
| 115 // This is a critical point in the startup process. | 110 // This is a critical point in the startup process. |
| 116 { | 111 { |
| 117 TRACE_EVENT0("startup", | 112 TRACE_EVENT0("startup", |
| 118 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:CreateUiMsgLoop"); | 113 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:CreateUiMsgLoop"); |
| (...skipping 19 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 |