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/prefs/pref_registry_simple.h" | 8 #include "base/prefs/pref_registry_simple.h" |
9 #include "chromecast/common/chromecast_config.h" | 9 #include "chromecast/common/chromecast_config.h" |
10 #include "chromecast/net/network_change_notifier_cast.h" | 10 #include "chromecast/net/network_change_notifier_cast.h" |
11 #include "chromecast/net/network_change_notifier_factory_cast.h" | 11 #include "chromecast/net/network_change_notifier_factory_cast.h" |
12 #include "chromecast/service/cast_service.h" | 12 #include "chromecast/service/cast_service.h" |
13 #include "chromecast/shell/browser/cast_browser_context.h" | 13 #include "chromecast/shell/browser/cast_browser_context.h" |
14 #include "chromecast/shell/browser/devtools/remote_debugging_server.h" | 14 #include "chromecast/shell/browser/devtools/remote_debugging_server.h" |
15 #include "chromecast/shell/browser/url_request_context_factory.h" | 15 #include "chromecast/shell/browser/url_request_context_factory.h" |
| 16 #include "chromecast/shell/browser/webui/webui_cast.h" |
16 | 17 |
17 namespace chromecast { | 18 namespace chromecast { |
18 namespace shell { | 19 namespace shell { |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 struct DefaultCommandLineSwitch { | 23 struct DefaultCommandLineSwitch { |
23 const char* const switch_name; | 24 const char* const switch_name; |
24 const char* const switch_value; | 25 const char* const switch_value; |
25 }; | 26 }; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 ChromecastConfig::Create(new PrefRegistrySimple()); | 69 ChromecastConfig::Create(new PrefRegistrySimple()); |
69 return 0; | 70 return 0; |
70 } | 71 } |
71 | 72 |
72 void CastBrowserMainParts::PreMainMessageLoopRun() { | 73 void CastBrowserMainParts::PreMainMessageLoopRun() { |
73 url_request_context_factory_->InitializeOnUIThread(); | 74 url_request_context_factory_->InitializeOnUIThread(); |
74 | 75 |
75 browser_context_.reset(new CastBrowserContext(url_request_context_factory_)); | 76 browser_context_.reset(new CastBrowserContext(url_request_context_factory_)); |
76 dev_tools_.reset(new RemoteDebuggingServer()); | 77 dev_tools_.reset(new RemoteDebuggingServer()); |
77 | 78 |
| 79 InitializeWebUI(); |
| 80 |
78 cast_service_.reset(CastService::Create(browser_context_.get())); | 81 cast_service_.reset(CastService::Create(browser_context_.get())); |
79 cast_service_->Start(); | 82 cast_service_->Start(); |
80 } | 83 } |
81 | 84 |
82 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { | 85 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { |
83 base::MessageLoopForUI::current()->Run(); | 86 base::MessageLoopForUI::current()->Run(); |
84 return true; | 87 return true; |
85 } | 88 } |
86 | 89 |
87 void CastBrowserMainParts::PostMainMessageLoopRun() { | 90 void CastBrowserMainParts::PostMainMessageLoopRun() { |
88 cast_service_->Stop(); | 91 cast_service_->Stop(); |
89 | 92 |
90 cast_service_.reset(); | 93 cast_service_.reset(); |
91 dev_tools_.reset(); | 94 dev_tools_.reset(); |
92 browser_context_.reset(); | 95 browser_context_.reset(); |
93 } | 96 } |
94 | 97 |
95 } // namespace shell | 98 } // namespace shell |
96 } // namespace chromecast | 99 } // namespace chromecast |
OLD | NEW |