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

Side by Side Diff: chromecast/graphics/cast_screen.cc

Issue 2468093003: Makes Screen functions take a const gfx::NativeView (Closed)
Patch Set: merge Created 4 years, 1 month 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
« no previous file with comments | « chromecast/graphics/cast_screen.h ('k') | extensions/shell/browser/shell_screen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/graphics/cast_screen.h" 5 #include "chromecast/graphics/cast_screen.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chromecast/public/graphics_properties_shlib.h" 10 #include "chromecast/public/graphics_properties_shlib.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 int CastScreen::GetNumDisplays() const { 54 int CastScreen::GetNumDisplays() const {
55 return 1; 55 return 1;
56 } 56 }
57 57
58 std::vector<display::Display> CastScreen::GetAllDisplays() const { 58 std::vector<display::Display> CastScreen::GetAllDisplays() const {
59 return std::vector<display::Display>(1, display_); 59 return std::vector<display::Display>(1, display_);
60 } 60 }
61 61
62 display::Display CastScreen::GetDisplayNearestWindow( 62 display::Display CastScreen::GetDisplayNearestWindow(
63 gfx::NativeWindow window) const { 63 const gfx::NativeWindow window) const {
64 return display_; 64 return display_;
65 } 65 }
66 66
67 display::Display CastScreen::GetDisplayNearestPoint( 67 display::Display CastScreen::GetDisplayNearestPoint(
68 const gfx::Point& point) const { 68 const gfx::Point& point) const {
69 return display_; 69 return display_;
70 } 70 }
71 71
72 display::Display CastScreen::GetDisplayMatching( 72 display::Display CastScreen::GetDisplayMatching(
73 const gfx::Rect& match_rect) const { 73 const gfx::Rect& match_rect) const {
74 return display_; 74 return display_;
75 } 75 }
76 76
77 display::Display CastScreen::GetPrimaryDisplay() const { 77 display::Display CastScreen::GetPrimaryDisplay() const {
78 return display_; 78 return display_;
79 } 79 }
80 80
81 void CastScreen::AddObserver(display::DisplayObserver* observer) {} 81 void CastScreen::AddObserver(display::DisplayObserver* observer) {}
82 82
83 void CastScreen::RemoveObserver(display::DisplayObserver* observer) {} 83 void CastScreen::RemoveObserver(display::DisplayObserver* observer) {}
84 84
85 CastScreen::CastScreen() : display_(kDisplayId) { 85 CastScreen::CastScreen() : display_(kDisplayId) {
86 // Device scale factor computed relative to 720p display 86 // Device scale factor computed relative to 720p display
87 const gfx::Size size = GetScreenResolution(); 87 const gfx::Size size = GetScreenResolution();
88 const float device_scale_factor = size.height() / 720.0f; 88 const float device_scale_factor = size.height() / 720.0f;
89 display_.SetScaleAndBounds(device_scale_factor, gfx::Rect(size)); 89 display_.SetScaleAndBounds(device_scale_factor, gfx::Rect(size));
90 } 90 }
91 91
92 } // namespace chromecast 92 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/graphics/cast_screen.h ('k') | extensions/shell/browser/shell_screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698