| 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/service/cast_service_simple.h" | 5 #include "chromecast/browser/service/cast_service_simple.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "chromecast/browser/cast_content_window.h" | 9 #include "chromecast/browser/cast_content_window.h" |
| 10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 GURL url(args[0]); | 26 GURL url(args[0]); |
| 27 if (url.is_valid() && url.has_scheme()) | 27 if (url.is_valid() && url.has_scheme()) |
| 28 return url; | 28 return url; |
| 29 | 29 |
| 30 return net::FilePathToFileURL( | 30 return net::FilePathToFileURL( |
| 31 base::MakeAbsoluteFilePath(base::FilePath(args[0]))); | 31 base::MakeAbsoluteFilePath(base::FilePath(args[0]))); |
| 32 } | 32 } |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 // static | |
| 37 scoped_ptr<CastService> CastService::Create( | |
| 38 content::BrowserContext* browser_context, | |
| 39 PrefService* pref_service, | |
| 40 metrics::CastMetricsServiceClient* metrics_service_client, | |
| 41 net::URLRequestContextGetter* request_context_getter) { | |
| 42 return scoped_ptr<CastService>(new CastServiceSimple(browser_context, | |
| 43 pref_service, | |
| 44 metrics_service_client)); | |
| 45 } | |
| 46 | |
| 47 CastServiceSimple::CastServiceSimple( | 36 CastServiceSimple::CastServiceSimple( |
| 48 content::BrowserContext* browser_context, | 37 content::BrowserContext* browser_context, |
| 49 PrefService* pref_service, | 38 PrefService* pref_service) |
| 50 metrics::CastMetricsServiceClient* metrics_service_client) | 39 : CastService(browser_context, pref_service) { |
| 51 : CastService(browser_context, pref_service, metrics_service_client) { | |
| 52 } | 40 } |
| 53 | 41 |
| 54 CastServiceSimple::~CastServiceSimple() { | 42 CastServiceSimple::~CastServiceSimple() { |
| 55 } | 43 } |
| 56 | 44 |
| 57 void CastServiceSimple::InitializeInternal() { | 45 void CastServiceSimple::InitializeInternal() { |
| 58 startup_url_ = GetStartupURL(); | 46 startup_url_ = GetStartupURL(); |
| 59 } | 47 } |
| 60 | 48 |
| 61 void CastServiceSimple::FinalizeInternal() { | 49 void CastServiceSimple::FinalizeInternal() { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 74 std::string()); | 62 std::string()); |
| 75 } | 63 } |
| 76 | 64 |
| 77 void CastServiceSimple::StopInternal() { | 65 void CastServiceSimple::StopInternal() { |
| 78 web_contents_->ClosePage(); | 66 web_contents_->ClosePage(); |
| 79 web_contents_.reset(); | 67 web_contents_.reset(); |
| 80 window_.reset(); | 68 window_.reset(); |
| 81 } | 69 } |
| 82 | 70 |
| 83 } // namespace chromecast | 71 } // namespace chromecast |
| OLD | NEW |