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

Side by Side Diff: headless/lib/browser/headless_screen.cc

Issue 2751833004: Reland "Add display::GetDisplayNearestView" (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « headless/lib/browser/headless_screen.h ('k') | ui/android/display_android_manager.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "headless/lib/browser/headless_screen.h" 5 #include "headless/lib/browser/headless_screen.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 19 matching lines...) Expand all
30 bool HeadlessScreen::IsWindowUnderCursor(gfx::NativeWindow window) { 30 bool HeadlessScreen::IsWindowUnderCursor(gfx::NativeWindow window) {
31 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window; 31 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window;
32 } 32 }
33 33
34 gfx::NativeWindow HeadlessScreen::GetWindowAtScreenPoint( 34 gfx::NativeWindow HeadlessScreen::GetWindowAtScreenPoint(
35 const gfx::Point& point) { 35 const gfx::Point& point) {
36 return nullptr; 36 return nullptr;
37 } 37 }
38 38
39 display::Display HeadlessScreen::GetDisplayNearestWindow( 39 display::Display HeadlessScreen::GetDisplayNearestWindow(
40 gfx::NativeView window) const { 40 gfx::NativeWindow window) const {
41 return GetPrimaryDisplay(); 41 return GetPrimaryDisplay();
42 } 42 }
43 43
44 HeadlessScreen::HeadlessScreen(const gfx::Rect& screen_bounds) { 44 HeadlessScreen::HeadlessScreen(const gfx::Rect& screen_bounds) {
45 static int64_t synthesized_display_id = 2000; 45 static int64_t synthesized_display_id = 2000;
46 display::Display display(synthesized_display_id++); 46 display::Display display(synthesized_display_id++);
47 display.SetScaleAndBounds(1.0f, screen_bounds); 47 display.SetScaleAndBounds(1.0f, screen_bounds);
48 ProcessDisplayChanged(display, true /* is_primary */); 48 ProcessDisplayChanged(display, true /* is_primary */);
49 } 49 }
50 50
51 } // namespace headless 51 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_screen.h ('k') | ui/android/display_android_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698