| 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/browser/cast_browser_main_parts.h" | 5 #include "chromecast/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 "cc/base/switches.h" | 10 #include "cc/base/switches.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // This is needed for now to enable the egltest Ozone platform to work with | 57 // This is needed for now to enable the egltest Ozone platform to work with |
| 58 // current Linux/NVidia OpenGL drivers. | 58 // current Linux/NVidia OpenGL drivers. |
| 59 { switches::kIgnoreGpuBlacklist, ""}, | 59 { switches::kIgnoreGpuBlacklist, ""}, |
| 60 // TODO(gusfernandez): This is needed to fix a bug with | 60 // TODO(gusfernandez): This is needed to fix a bug with |
| 61 // glPostSubBufferCHROMIUM (crbug.com/429200) | 61 // glPostSubBufferCHROMIUM (crbug.com/429200) |
| 62 { cc::switches::kUIDisablePartialSwap, ""}, | 62 { cc::switches::kUIDisablePartialSwap, ""}, |
| 63 #endif | 63 #endif |
| 64 { NULL, NULL }, // Termination | 64 { NULL, NULL }, // Termination |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 void AddDefaultCommandLineSwitches(CommandLine* command_line) { | 67 void AddDefaultCommandLineSwitches(base::CommandLine* command_line) { |
| 68 int i = 0; | 68 int i = 0; |
| 69 while (g_default_switches[i].switch_name != NULL) { | 69 while (g_default_switches[i].switch_name != NULL) { |
| 70 command_line->AppendSwitchASCII( | 70 command_line->AppendSwitchASCII( |
| 71 std::string(g_default_switches[i].switch_name), | 71 std::string(g_default_switches[i].switch_name), |
| 72 std::string(g_default_switches[i].switch_value)); | 72 std::string(g_default_switches[i].switch_value)); |
| 73 ++i; | 73 ++i; |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace | 77 } // namespace |
| 78 | 78 |
| 79 CastBrowserMainParts::CastBrowserMainParts( | 79 CastBrowserMainParts::CastBrowserMainParts( |
| 80 const content::MainFunctionParams& parameters, | 80 const content::MainFunctionParams& parameters, |
| 81 URLRequestContextFactory* url_request_context_factory) | 81 URLRequestContextFactory* url_request_context_factory) |
| 82 : BrowserMainParts(), | 82 : BrowserMainParts(), |
| 83 cast_browser_process_(new CastBrowserProcess()), | 83 cast_browser_process_(new CastBrowserProcess()), |
| 84 parameters_(parameters), | 84 parameters_(parameters), |
| 85 url_request_context_factory_(url_request_context_factory) { | 85 url_request_context_factory_(url_request_context_factory) { |
| 86 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 86 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 87 AddDefaultCommandLineSwitches(command_line); | 87 AddDefaultCommandLineSwitches(command_line); |
| 88 } | 88 } |
| 89 | 89 |
| 90 CastBrowserMainParts::~CastBrowserMainParts() { | 90 CastBrowserMainParts::~CastBrowserMainParts() { |
| 91 } | 91 } |
| 92 | 92 |
| 93 void CastBrowserMainParts::PreMainMessageLoopStart() { | 93 void CastBrowserMainParts::PreMainMessageLoopStart() { |
| 94 #if defined(OS_ANDROID) | 94 #if defined(OS_ANDROID) |
| 95 net::NetworkChangeNotifier::SetFactory( | 95 net::NetworkChangeNotifier::SetFactory( |
| 96 new net::NetworkChangeNotifierFactoryAndroid()); | 96 new net::NetworkChangeNotifierFactoryAndroid()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 return true; | 167 return true; |
| 168 } | 168 } |
| 169 | 169 |
| 170 void CastBrowserMainParts::PostMainMessageLoopRun() { | 170 void CastBrowserMainParts::PostMainMessageLoopRun() { |
| 171 cast_browser_process_->cast_service()->Stop(); | 171 cast_browser_process_->cast_service()->Stop(); |
| 172 cast_browser_process_.reset(); | 172 cast_browser_process_.reset(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace shell | 175 } // namespace shell |
| 176 } // namespace chromecast | 176 } // namespace chromecast |
| OLD | NEW |