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

Unified Diff: chromecast/browser/service/cast_service_simple.cc

Issue 2626863006: [Chromecast] Add CastWebContents (Closed)
Patch Set: [Chromecast] Add CastWebContents Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/browser/service/cast_service_simple.h ('k') | chromecast/browser/test/cast_browser_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/service/cast_service_simple.cc
diff --git a/chromecast/browser/service/cast_service_simple.cc b/chromecast/browser/service/cast_service_simple.cc
index d2ac5b755a9678aa490b1a02851e52c738b56be7..96c4a48f2ace5f7c737479cc7a31665ccf05a7e4 100644
--- a/chromecast/browser/service/cast_service_simple.cc
+++ b/chromecast/browser/service/cast_service_simple.cc
@@ -9,11 +9,9 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
-#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "net/base/filename_util.h"
-#include "net/url_request/url_request_context_getter.h"
namespace chromecast {
namespace shell {
@@ -60,26 +58,24 @@ void CastServiceSimple::StartInternal() {
return;
}
- window_ = CastContentWindow::Create(this);
- web_contents_ = window_->CreateWebContents(browser_context());
- window_->ShowWebContents(web_contents_.get(), window_manager_);
-
- web_contents_->GetController().LoadURL(startup_url_, content::Referrer(),
- ui::PAGE_TRANSITION_TYPED,
- std::string());
- web_contents_->Focus();
+ cast_web_view_ = base::MakeUnique<CastWebView>(this, browser_context(),
+ /*site_instance*/ nullptr,
+ /*transparent*/ false);
+ cast_web_view_->Show(window_manager_);
+ cast_web_view_->LoadUrl(startup_url_);
}
void CastServiceSimple::StopInternal() {
- if (web_contents_) {
- web_contents_->ClosePage();
- web_contents_.reset();
- }
- if (window_) {
- window_.reset();
+ if (cast_web_view_) {
+ cast_web_view_->ClosePage();
}
+ cast_web_view_.reset();
}
+void CastServiceSimple::OnPageStopped(int error_code) {}
+
+void CastServiceSimple::OnLoadingStateChanged(bool loading) {}
+
void CastServiceSimple::OnWindowDestroyed() {}
void CastServiceSimple::OnKeyEvent(const ui::KeyEvent& key_event) {}
« no previous file with comments | « chromecast/browser/service/cast_service_simple.h ('k') | chromecast/browser/test/cast_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698