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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 10823067: Add a function to layout.h for getting ScaleFactor of the native view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/layout.h » ('j') | ui/base/layout_mac.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 16c3eed41318699302431743426758278a7a5cd2..7408ae19a590733ec0cd67cdaa08c006277cbc2f 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -48,6 +48,7 @@
#include "third_party/skia/include/core/SkColor.h"
#import "ui/base/cocoa/fullscreen_window_manager.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
+#include "ui/base/layout.h"
#include "ui/gfx/point.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
#include "ui/surface/io_surface_support_mac.h"
@@ -74,10 +75,6 @@ using WebKit::WebGestureEvent;
+ (void)removeMonitor:(id)eventMonitor;
@end
-@interface NSScreen (LionAPI)
-- (CGFloat)backingScaleFactor;
-@end
-
@interface NSWindow (LionAPI)
- (CGFloat)backingScaleFactor;
@end
@@ -110,17 +107,7 @@ static inline int ToWebKitModifiers(NSUInteger flags) {
}
static float ScaleFactor(NSView* view) {
- if (NSWindow* window = [view window]) {
- if ([window respondsToSelector:@selector(backingScaleFactor)])
- return [window backingScaleFactor];
- return [window userSpaceScaleFactor];
- }
- if (NSScreen* screen = [NSScreen mainScreen]) {
- if ([screen respondsToSelector:@selector(backingScaleFactor)])
- return [screen backingScaleFactor];
- return [screen userSpaceScaleFactor];
- }
- return 1;
+ return ui::GetScaleFactorScale(ui::GetScaleFactorForNativeView(view));
Nico 2012/08/02 21:26:52 doesn't GetScaleFactorForNativeView() return a sca
mazda 2012/08/02 22:42:24 GetScaleFactorForNativeView returns ScaleFactor (e
Nico 2012/08/02 22:43:16 Ah, ok. Might make sense if it's needed in more pl
}
// Private methods:
« no previous file with comments | « no previous file | ui/base/layout.h » ('j') | ui/base/layout_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698