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

Side by Side Diff: ui/display/android/screen_android.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 | « ui/aura/test/test_screen.cc ('k') | ui/display/ios/screen_ios.mm » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/display/screen.h" 5 #include "ui/display/screen.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/display/display.h" 9 #include "ui/display/display.h"
10 #include "ui/gfx/android/device_display_info.h" 10 #include "ui/gfx/android/device_display_info.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 Display display(0, bounds_in_dip); 46 Display display(0, bounds_in_dip);
47 if (!Display::HasForceDeviceScaleFactor()) 47 if (!Display::HasForceDeviceScaleFactor())
48 display.set_device_scale_factor(device_scale_factor); 48 display.set_device_scale_factor(device_scale_factor);
49 display.SetRotationAsDegree(device_info.GetRotationDegrees()); 49 display.SetRotationAsDegree(device_info.GetRotationDegrees());
50 display.set_color_depth(device_info.GetBitsPerPixel()); 50 display.set_color_depth(device_info.GetBitsPerPixel());
51 display.set_depth_per_component(device_info.GetBitsPerComponent()); 51 display.set_depth_per_component(device_info.GetBitsPerComponent());
52 display.set_is_monochrome(device_info.GetBitsPerComponent() == 0); 52 display.set_is_monochrome(device_info.GetBitsPerComponent() == 0);
53 return display; 53 return display;
54 } 54 }
55 55
56 Display GetDisplayNearestWindow(gfx::NativeView view) const override { 56 Display GetDisplayNearestWindow(const gfx::NativeView view) const override {
57 return GetPrimaryDisplay(); 57 return GetPrimaryDisplay();
58 } 58 }
59 59
60 Display GetDisplayNearestPoint(const gfx::Point& point) const override { 60 Display GetDisplayNearestPoint(const gfx::Point& point) const override {
61 return GetPrimaryDisplay(); 61 return GetPrimaryDisplay();
62 } 62 }
63 63
64 int GetNumDisplays() const override { return 1; } 64 int GetNumDisplays() const override { return 1; }
65 65
66 std::vector<Display> GetAllDisplays() const override { 66 std::vector<Display> GetAllDisplays() const override {
(...skipping 14 matching lines...) Expand all
81 81
82 private: 82 private:
83 DISALLOW_COPY_AND_ASSIGN(ScreenAndroid); 83 DISALLOW_COPY_AND_ASSIGN(ScreenAndroid);
84 }; 84 };
85 85
86 Screen* CreateNativeScreen() { 86 Screen* CreateNativeScreen() {
87 return new ScreenAndroid; 87 return new ScreenAndroid;
88 } 88 }
89 89
90 } // namespace display 90 } // namespace display
OLDNEW
« no previous file with comments | « ui/aura/test/test_screen.cc ('k') | ui/display/ios/screen_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698