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

Side by Side Diff: chromecast/browser/service/cast_service_simple.cc

Issue 823763002: Seperate creation of WebContents and window tree in CastContentWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
OLDNEW
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 "chromecast/browser/cast_content_window.h" 8 #include "chromecast/browser/cast_content_window.h"
9 #include "content/public/browser/render_view_host.h" 9 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 void CastServiceSimple::FinalizeInternal() { 59 void CastServiceSimple::FinalizeInternal() {
60 } 60 }
61 61
62 void CastServiceSimple::StartInternal() { 62 void CastServiceSimple::StartInternal() {
63 // This is the simple version that hard-codes the size. 63 // This is the simple version that hard-codes the size.
64 gfx::Size initial_size(1280, 720); 64 gfx::Size initial_size(1280, 720);
65 65
66 window_.reset(new CastContentWindow); 66 window_.reset(new CastContentWindow);
67 web_contents_ = window_->Create(initial_size, browser_context()); 67 web_contents_ = window_->CreateWebContents(initial_size, browser_context());
68 window_->CreateWindowTree(initial_size, web_contents_.get());
68 69
69 web_contents_->GetController().LoadURL(GetStartupURL(), 70 web_contents_->GetController().LoadURL(GetStartupURL(),
70 content::Referrer(), 71 content::Referrer(),
71 ui::PAGE_TRANSITION_TYPED, 72 ui::PAGE_TRANSITION_TYPED,
72 std::string()); 73 std::string());
73 } 74 }
74 75
75 void CastServiceSimple::StopInternal() { 76 void CastServiceSimple::StopInternal() {
76 web_contents_->GetRenderViewHost()->ClosePage(); 77 web_contents_->GetRenderViewHost()->ClosePage();
77 web_contents_.reset(); 78 web_contents_.reset();
78 window_.reset(); 79 window_.reset();
79 } 80 }
80 81
81 } // namespace chromecast 82 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698