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

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

Issue 1972433002: [Chromecast] Handle device scale factor correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test compile error Created 4 years, 7 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 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 "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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 void CastServiceSimple::InitializeInternal() { 46 void CastServiceSimple::InitializeInternal() {
47 startup_url_ = GetStartupURL(); 47 startup_url_ = GetStartupURL();
48 } 48 }
49 49
50 void CastServiceSimple::FinalizeInternal() { 50 void CastServiceSimple::FinalizeInternal() {
51 } 51 }
52 52
53 void CastServiceSimple::StartInternal() { 53 void CastServiceSimple::StartInternal() {
54 // This is the simple version that hard-codes the size.
55 gfx::Size initial_size(1280, 720);
56
57 window_.reset(new CastContentWindow); 54 window_.reset(new CastContentWindow);
58 web_contents_ = window_->CreateWebContents(initial_size, browser_context()); 55 web_contents_ = window_->CreateWebContents(browser_context());
59 window_->CreateWindowTree(initial_size, web_contents_.get()); 56 window_->CreateWindowTree(web_contents_.get());
60 57
61 web_contents_->GetController().LoadURL(startup_url_, content::Referrer(), 58 web_contents_->GetController().LoadURL(startup_url_, content::Referrer(),
62 ui::PAGE_TRANSITION_TYPED, 59 ui::PAGE_TRANSITION_TYPED,
63 std::string()); 60 std::string());
64 } 61 }
65 62
66 void CastServiceSimple::StopInternal() { 63 void CastServiceSimple::StopInternal() {
67 web_contents_->ClosePage(); 64 web_contents_->ClosePage();
68 web_contents_.reset(); 65 web_contents_.reset();
69 window_.reset(); 66 window_.reset();
70 } 67 }
71 68
72 } // namespace shell 69 } // namespace shell
73 } // namespace chromecast 70 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/cast_content_window.cc ('k') | chromecast/browser/test/chromecast_browser_test_helper_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698