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

Side by Side Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 10 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 | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/cocoa/tooltip_manager_mac.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 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 #import "ui/views/cocoa/bridged_native_widget.h" 5 #import "ui/views/cocoa/bridged_native_widget.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 // Margin at edge and corners of the window that trigger resizing. These match 90 // Margin at edge and corners of the window that trigger resizing. These match
91 // actual Cocoa resize margins. 91 // actual Cocoa resize margins.
92 const int kResizeAreaEdgeSize = 3; 92 const int kResizeAreaEdgeSize = 3;
93 const int kResizeAreaCornerSize = 12; 93 const int kResizeAreaCornerSize = 12;
94 94
95 int kWindowPropertiesKey; 95 int kWindowPropertiesKey;
96 96
97 float GetDeviceScaleFactorFromView(NSView* view) { 97 float GetDeviceScaleFactorFromView(NSView* view) {
98 gfx::Display display = 98 gfx::Display display =
99 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); 99 gfx::Screen::GetScreen()->GetDisplayNearestWindow(view);
100 DCHECK(display.is_valid()); 100 DCHECK(display.is_valid());
101 return display.device_scale_factor(); 101 return display.device_scale_factor();
102 } 102 }
103 103
104 // Returns true if bounds passed to window in SetBounds should be treated as 104 // Returns true if bounds passed to window in SetBounds should be treated as
105 // though they are in screen coordinates. 105 // though they are in screen coordinates.
106 bool PositionWindowInScreenCoordinates(views::Widget* widget, 106 bool PositionWindowInScreenCoordinates(views::Widget* widget,
107 views::Widget::InitParams::Type type) { 107 views::Widget::InitParams::Type type) {
108 // Replicate the logic in desktop_aura/desktop_screen_position_client.cc. 108 // Replicate the logic in desktop_aura/desktop_screen_position_client.cc.
109 if (views::GetAuraWindowTypeForWidgetType(type) == ui::wm::WINDOW_TYPE_POPUP) 109 if (views::GetAuraWindowTypeForWidgetType(type) == ui::wm::WINDOW_TYPE_POPUP)
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 [bridged_view_ setMouseDownCanMoveWindow:draggable]; 1211 [bridged_view_ setMouseDownCanMoveWindow:draggable];
1212 // AppKit will not update its cache of mouseDownCanMoveWindow unless something 1212 // AppKit will not update its cache of mouseDownCanMoveWindow unless something
1213 // changes. Previously we tried adding an NSView and removing it, but for some 1213 // changes. Previously we tried adding an NSView and removing it, but for some
1214 // reason it required reposting the mouse-down event, and didn't always work. 1214 // reason it required reposting the mouse-down event, and didn't always work.
1215 // Calling the below seems to be an effective solution. 1215 // Calling the below seems to be an effective solution.
1216 [window_ setMovableByWindowBackground:NO]; 1216 [window_ setMovableByWindowBackground:NO];
1217 [window_ setMovableByWindowBackground:YES]; 1217 [window_ setMovableByWindowBackground:YES];
1218 } 1218 }
1219 1219
1220 } // namespace views 1220 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/cocoa/tooltip_manager_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698