| 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/app/android/chrome_main_delegate_android.h" | 5 #include "chrome/app/android/chrome_main_delegate_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/base_paths_android.h" | 8 #include "base/base_paths_android.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/logging.h" | 11 #include "base/logging.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_startup_flags.h" | 14 #include "chrome/browser/android/chrome_startup_flags.h" |
| 15 #include "chrome/browser/android/metrics/uma_utils.h" | 15 #include "chrome/browser/android/metrics/uma_utils.h" |
| 16 #include "chrome/browser/android/metrics/uma_utils.h" | 16 #include "chrome/browser/android/metrics/uma_utils.h" |
| 17 #include "chrome/browser/media/android/remote/remote_media_player_manager.h" | |
| 18 #include "components/policy/core/browser/android/android_combined_policy_provide
r.h" | 17 #include "components/policy/core/browser/android/android_combined_policy_provide
r.h" |
| 19 #include "components/startup_metric_utils/browser/startup_metric_utils.h" | 18 #include "components/startup_metric_utils/browser/startup_metric_utils.h" |
| 20 #include "content/browser/media/android/browser_media_player_manager.h" | 19 #include "content/browser/media/android/browser_media_player_manager.h" |
| 21 #include "content/public/browser/browser_main_runner.h" | 20 #include "content/public/browser/browser_main_runner.h" |
| 22 | 21 |
| 23 #if defined(SAFE_BROWSING_DB_REMOTE) | 22 #if defined(SAFE_BROWSING_DB_REMOTE) |
| 24 #include "chrome/browser/safe_browsing/safe_browsing_api_handler.h" | 23 #include "chrome/browser/safe_browsing/safe_browsing_api_handler.h" |
| 25 using safe_browsing::SafeBrowsingApiHandler; | 24 using safe_browsing::SafeBrowsingApiHandler; |
| 26 #endif | 25 #endif |
| 27 | 26 |
| 27 #if !defined(USE_AURA) |
| 28 #include "chrome/browser/media/android/remote/remote_media_player_manager.h" |
| 29 #endif |
| 30 |
| 28 namespace { | 31 namespace { |
| 29 | 32 |
| 33 #if !defined(USE_AURA) |
| 30 content::BrowserMediaPlayerManager* CreateRemoteMediaPlayerManager( | 34 content::BrowserMediaPlayerManager* CreateRemoteMediaPlayerManager( |
| 31 content::RenderFrameHost* render_frame_host) { | 35 content::RenderFrameHost* render_frame_host) { |
| 32 return new remote_media::RemoteMediaPlayerManager(render_frame_host); | 36 return new remote_media::RemoteMediaPlayerManager(render_frame_host); |
| 33 } | 37 } |
| 38 #endif |
| 34 | 39 |
| 35 } // namespace | 40 } // namespace |
| 36 | 41 |
| 37 // ChromeMainDelegateAndroid is created when the library is loaded. It is always | 42 // ChromeMainDelegateAndroid is created when the library is loaded. It is always |
| 38 // done in the process's main Java thread. But for non browser process, e.g. | 43 // done in the process's main Java thread. But for non browser process, e.g. |
| 39 // renderer process, it is not the native Chrome's main thread. | 44 // renderer process, it is not the native Chrome's main thread. |
| 40 ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() { | 45 ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() { |
| 41 } | 46 } |
| 42 | 47 |
| 43 ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() { | 48 ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() { |
| 44 } | 49 } |
| 45 | 50 |
| 46 bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) { | 51 bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) { |
| 47 #if defined(SAFE_BROWSING_DB_REMOTE) | 52 #if defined(SAFE_BROWSING_DB_REMOTE) |
| 48 safe_browsing_api_handler_.reset(CreateSafeBrowsingApiHandler()); | 53 safe_browsing_api_handler_.reset(CreateSafeBrowsingApiHandler()); |
| 49 SafeBrowsingApiHandler::SetInstance(safe_browsing_api_handler_.get()); | 54 SafeBrowsingApiHandler::SetInstance(safe_browsing_api_handler_.get()); |
| 50 #endif | 55 #endif |
| 51 | 56 |
| 52 policy::android::AndroidCombinedPolicyProvider::SetShouldWaitForPolicy(true); | 57 policy::android::AndroidCombinedPolicyProvider::SetShouldWaitForPolicy(true); |
| 53 SetChromeSpecificCommandLineFlags(); | 58 SetChromeSpecificCommandLineFlags(); |
| 59 #if !defined(USE_AURA) |
| 54 content::BrowserMediaPlayerManager::RegisterFactory( | 60 content::BrowserMediaPlayerManager::RegisterFactory( |
| 55 &CreateRemoteMediaPlayerManager); | 61 &CreateRemoteMediaPlayerManager); |
| 62 #endif |
| 56 | 63 |
| 57 return ChromeMainDelegate::BasicStartupComplete(exit_code); | 64 return ChromeMainDelegate::BasicStartupComplete(exit_code); |
| 58 } | 65 } |
| 59 | 66 |
| 60 void ChromeMainDelegateAndroid::SandboxInitialized( | 67 void ChromeMainDelegateAndroid::SandboxInitialized( |
| 61 const std::string& process_type) { | 68 const std::string& process_type) { |
| 62 ChromeMainDelegate::SandboxInitialized(process_type); | 69 ChromeMainDelegate::SandboxInitialized(process_type); |
| 63 } | 70 } |
| 64 | 71 |
| 65 int ChromeMainDelegateAndroid::RunProcess( | 72 int ChromeMainDelegateAndroid::RunProcess( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 SafeBrowsingApiHandler::SetInstance(nullptr); | 118 SafeBrowsingApiHandler::SetInstance(nullptr); |
| 112 #endif | 119 #endif |
| 113 } | 120 } |
| 114 | 121 |
| 115 #if defined(SAFE_BROWSING_DB_REMOTE) | 122 #if defined(SAFE_BROWSING_DB_REMOTE) |
| 116 SafeBrowsingApiHandler* | 123 SafeBrowsingApiHandler* |
| 117 ChromeMainDelegateAndroid::CreateSafeBrowsingApiHandler() { | 124 ChromeMainDelegateAndroid::CreateSafeBrowsingApiHandler() { |
| 118 return nullptr; | 125 return nullptr; |
| 119 } | 126 } |
| 120 #endif | 127 #endif |
| OLD | NEW |