Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: chrome/app/android/chrome_main_delegate_android.cc

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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" 11 #include "chrome/browser/android/metrics/uma_utils.h"
12 #include "chrome/browser/media/android/remote/remote_media_player_manager.h" 12 #include "chrome/browser/media/android/remote/remote_media_player_manager.h"
13 #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" 14 #include "content/browser/media/android/browser_media_player_manager.h"
15 #include "content/public/browser/browser_main_runner.h" 15 #include "content/public/browser/browser_main_runner.h"
16 16
17 namespace { 17 namespace {
18 18
19 #if !defined(USE_AURA)
19 content::BrowserMediaPlayerManager* CreateRemoteMediaPlayerManager( 20 content::BrowserMediaPlayerManager* CreateRemoteMediaPlayerManager(
20 content::RenderFrameHost* render_frame_host, 21 content::RenderFrameHost* render_frame_host,
21 content::MediaPlayersObserver* audio_monitor) { 22 content::MediaPlayersObserver* audio_monitor) {
22 return new remote_media::RemoteMediaPlayerManager(render_frame_host, 23 return new remote_media::RemoteMediaPlayerManager(render_frame_host,
23 audio_monitor); 24 audio_monitor);
24 } 25 }
26 #endif
25 27
26 } // namespace 28 } // namespace
27 29
28 // ChromeMainDelegateAndroid is created when the library is loaded. It is always 30 // ChromeMainDelegateAndroid is created when the library is loaded. It is always
29 // done in the process's main Java thread. But for non browser process, e.g. 31 // done in the process's main Java thread. But for non browser process, e.g.
30 // renderer process, it is not the native Chrome's main thread. 32 // renderer process, it is not the native Chrome's main thread.
31 ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() { 33 ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() {
32 } 34 }
33 35
34 ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() { 36 ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() {
35 } 37 }
36 void ChromeMainDelegateAndroid::SandboxInitialized( 38 void ChromeMainDelegateAndroid::SandboxInitialized(
37 const std::string& process_type) { 39 const std::string& process_type) {
38 ChromeMainDelegate::SandboxInitialized(process_type); 40 ChromeMainDelegate::SandboxInitialized(process_type);
39 } 41 }
40 42
41 int ChromeMainDelegateAndroid::RunProcess( 43 int ChromeMainDelegateAndroid::RunProcess(
42 const std::string& process_type, 44 const std::string& process_type,
43 const content::MainFunctionParams& main_function_params) { 45 const content::MainFunctionParams& main_function_params) {
44 TRACE_EVENT0("startup", "ChromeMainDelegateAndroid::RunProcess") 46 TRACE_EVENT0("startup", "ChromeMainDelegateAndroid::RunProcess")
45 if (process_type.empty()) { 47 if (process_type.empty()) {
46 // Because the browser process can be started asynchronously as a series of 48 // Because the browser process can be started asynchronously as a series of
47 // UI thread tasks a second request to start it can come in while the 49 // UI thread tasks a second request to start it can come in while the
48 // first request is still being processed. Chrome must keep the same 50 // first request is still being processed. Chrome must keep the same
49 // browser runner for the second request. 51 // browser runner for the second request.
50 // Also only record the start time the first time round, since this is the 52 // Also only record the start time the first time round, since this is the
51 // start time of the application, and will be same for all requests. 53 // start time of the application, and will be same for all requests.
52 if (!browser_runner_.get()) { 54 if (!browser_runner_.get()) {
53 base::Time startTime = chrome::android::GetMainEntryPointTime(); 55 // base::Time startTime = chrome::android::GetMainEntryPointTime();
54 startup_metric_utils::RecordSavedMainEntryPointTime(startTime); 56 // startup_metric_utils::RecordSavedMainEntryPointTime(startTime);
55 browser_runner_.reset(content::BrowserMainRunner::Create()); 57 browser_runner_.reset(content::BrowserMainRunner::Create());
56 } 58 }
57 return browser_runner_->Initialize(main_function_params); 59 return browser_runner_->Initialize(main_function_params);
58 } 60 }
59 61
60 return ChromeMainDelegate::RunProcess(process_type, main_function_params); 62 return ChromeMainDelegate::RunProcess(process_type, main_function_params);
61 } 63 }
62 64
63 bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) { 65 bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) {
64 SetChromeSpecificCommandLineFlags(); 66 SetChromeSpecificCommandLineFlags();
65 67
68 #if !defined(USE_AURA)
66 content::BrowserMediaPlayerManager::RegisterFactory( 69 content::BrowserMediaPlayerManager::RegisterFactory(
67 &CreateRemoteMediaPlayerManager); 70 &CreateRemoteMediaPlayerManager);
71 #endif
68 72
69 return ChromeMainDelegate::BasicStartupComplete(exit_code); 73 return ChromeMainDelegate::BasicStartupComplete(exit_code);
70 } 74 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698