OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/shell/browser/cast_browser_main_parts.h" | 5 #include "chromecast/shell/browser/cast_browser_main_parts.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
10 #include "chromecast/common/chromecast_config.h" | 10 #include "chromecast/common/chromecast_config.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 metrics::CastMetricsServiceClient::Create( | 96 metrics::CastMetricsServiceClient::Create( |
97 content::BrowserThread::GetBlockingPool(), | 97 content::BrowserThread::GetBlockingPool(), |
98 ChromecastConfig::GetInstance()->pref_service(), | 98 ChromecastConfig::GetInstance()->pref_service(), |
99 cast_browser_process_->browser_context()->GetRequestContext())); | 99 cast_browser_process_->browser_context()->GetRequestContext())); |
100 cast_browser_process_->SetRemoteDebuggingServer(new RemoteDebuggingServer()); | 100 cast_browser_process_->SetRemoteDebuggingServer(new RemoteDebuggingServer()); |
101 | 101 |
102 InitializeWebUI(); | 102 InitializeWebUI(); |
103 | 103 |
104 cast_browser_process_->SetCastService( | 104 cast_browser_process_->SetCastService( |
105 CastService::Create(cast_browser_process_->browser_context(), | 105 CastService::Create(cast_browser_process_->browser_context(), |
106 url_request_context_factory_->GetSystemGetter())); | 106 url_request_context_factory_->GetSystemGetter())); |
lcwu1
2014/09/26 22:38:59
Now that I looked at the internal CLs, I think I a
gunsch
2014/09/26 23:03:05
Done.
| |
107 | |
108 // Initializing network delegates must happen after Cast service is created. | |
109 url_request_context_factory_->InitializeNetworkDelegates(); | |
107 cast_browser_process_->cast_service()->Start(); | 110 cast_browser_process_->cast_service()->Start(); |
108 } | 111 } |
109 | 112 |
110 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { | 113 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { |
111 // If parameters_.ui_task is not NULL, we are running browser tests. In this | 114 // If parameters_.ui_task is not NULL, we are running browser tests. In this |
112 // case, the browser's main message loop will not run. | 115 // case, the browser's main message loop will not run. |
113 if (parameters_.ui_task) { | 116 if (parameters_.ui_task) { |
114 parameters_.ui_task->Run(); | 117 parameters_.ui_task->Run(); |
115 } else { | 118 } else { |
116 base::MessageLoopForUI::current()->Run(); | 119 base::MessageLoopForUI::current()->Run(); |
117 } | 120 } |
118 return true; | 121 return true; |
119 } | 122 } |
120 | 123 |
121 void CastBrowserMainParts::PostMainMessageLoopRun() { | 124 void CastBrowserMainParts::PostMainMessageLoopRun() { |
122 cast_browser_process_->cast_service()->Stop(); | 125 cast_browser_process_->cast_service()->Stop(); |
123 cast_browser_process_.reset(); | 126 cast_browser_process_.reset(); |
124 } | 127 } |
125 | 128 |
126 } // namespace shell | 129 } // namespace shell |
127 } // namespace chromecast | 130 } // namespace chromecast |
OLD | NEW |