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/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "chrome/browser/android/chrome_startup_flags.h" | 9 #include "chrome/browser/android/chrome_startup_flags.h" |
10 #include "chrome/browser/android/metrics/uma_utils.h" | 10 #include "chrome/browser/android/metrics/uma_utils.h" |
11 #include "chrome/browser/android/metrics/uma_utils.h" | |
12 #include "chrome/browser/media/android/remote/remote_media_player_manager.h" | |
11 #include "components/startup_metric_utils/startup_metric_utils.h" | 13 #include "components/startup_metric_utils/startup_metric_utils.h" |
14 #include "content/browser/media/android/browser_media_player_manager.h" | |
12 #include "content/public/browser/browser_main_runner.h" | 15 #include "content/public/browser/browser_main_runner.h" |
13 | 16 |
14 // ChromeMainDelegateAndroid is created when the library is loaded. It is always | 17 // ChromeMainDelegateAndroid is created when the library is loaded. It is always |
15 // done in the process's main Java thread. But for non browser process, e.g. | 18 // done in the process's main Java thread. But for non browser process, e.g. |
16 // renderer process, it is not the native Chrome's main thread. | 19 // renderer process, it is not the native Chrome's main thread. |
17 ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() { | 20 ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() { |
18 } | 21 } |
19 | 22 |
20 ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() { | 23 ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() { |
21 } | 24 } |
25 static content::BrowserMediaPlayerManager* CreateRemoteMediaPlayerManager( | |
Bernhard Bauer
2015/03/13 12:18:02
Move this to an anonymous namespace at the top of
aberent
2015/03/13 19:04:35
Done.
| |
26 content::RenderFrameHost* render_frame_host, | |
27 content::MediaPlayersObserver* audio_monitor) { | |
28 return new remote_media::RemoteMediaPlayerManager(render_frame_host, | |
29 audio_monitor); | |
30 } | |
22 | 31 |
23 void ChromeMainDelegateAndroid::SandboxInitialized( | 32 void ChromeMainDelegateAndroid::SandboxInitialized( |
24 const std::string& process_type) { | 33 const std::string& process_type) { |
25 ChromeMainDelegate::SandboxInitialized(process_type); | 34 ChromeMainDelegate::SandboxInitialized(process_type); |
26 } | 35 } |
27 | 36 |
28 int ChromeMainDelegateAndroid::RunProcess( | 37 int ChromeMainDelegateAndroid::RunProcess( |
29 const std::string& process_type, | 38 const std::string& process_type, |
30 const content::MainFunctionParams& main_function_params) { | 39 const content::MainFunctionParams& main_function_params) { |
31 TRACE_EVENT0("startup", "ChromeMainDelegateAndroid::RunProcess") | 40 TRACE_EVENT0("startup", "ChromeMainDelegateAndroid::RunProcess") |
(...skipping 10 matching lines...) Expand all Loading... | |
42 browser_runner_.reset(content::BrowserMainRunner::Create()); | 51 browser_runner_.reset(content::BrowserMainRunner::Create()); |
43 } | 52 } |
44 return browser_runner_->Initialize(main_function_params); | 53 return browser_runner_->Initialize(main_function_params); |
45 } | 54 } |
46 | 55 |
47 return ChromeMainDelegate::RunProcess(process_type, main_function_params); | 56 return ChromeMainDelegate::RunProcess(process_type, main_function_params); |
48 } | 57 } |
49 | 58 |
50 bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) { | 59 bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) { |
51 SetChromeSpecificCommandLineFlags(); | 60 SetChromeSpecificCommandLineFlags(); |
61 | |
62 content::BrowserMediaPlayerManager::RegisterFactory( | |
63 &CreateRemoteMediaPlayerManager); | |
64 | |
52 return ChromeMainDelegate::BasicStartupComplete(exit_code); | 65 return ChromeMainDelegate::BasicStartupComplete(exit_code); |
53 } | 66 } |
OLD | NEW |