OLD | NEW |
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 "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <OpenGL/gl.h> | 8 #include <OpenGL/gl.h> |
9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
10 | 10 |
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 | 1651 |
1652 - (id)initWithRenderWidgetHostViewMac:(RenderWidgetHostViewMac*)r { | 1652 - (id)initWithRenderWidgetHostViewMac:(RenderWidgetHostViewMac*)r { |
1653 self = [super initWithFrame:NSZeroRect]; | 1653 self = [super initWithFrame:NSZeroRect]; |
1654 if (self) { | 1654 if (self) { |
1655 self.acceptsTouchEvents = YES; | 1655 self.acceptsTouchEvents = YES; |
1656 editCommand_helper_.reset(new RenderWidgetHostViewMacEditCommandHelper); | 1656 editCommand_helper_.reset(new RenderWidgetHostViewMacEditCommandHelper); |
1657 editCommand_helper_->AddEditingSelectorsToClass([self class]); | 1657 editCommand_helper_->AddEditingSelectorsToClass([self class]); |
1658 | 1658 |
1659 renderWidgetHostView_.reset(r); | 1659 renderWidgetHostView_.reset(r); |
1660 canBeKeyView_ = YES; | 1660 canBeKeyView_ = YES; |
| 1661 // TODO(miu): |takesFocusOnlyOnMouseDown_| is not used anymore and should be |
| 1662 // removed along with the exposed RWHV interface methods. |
| 1663 // http://crbug.com/424766 |
| 1664 takesFocusOnlyOnMouseDown_ = NO; |
1661 focusedPluginIdentifier_ = -1; | 1665 focusedPluginIdentifier_ = -1; |
1662 | 1666 |
1663 // OpenGL support: | 1667 // OpenGL support: |
1664 if ([self respondsToSelector: | 1668 if ([self respondsToSelector: |
1665 @selector(setWantsBestResolutionOpenGLSurface:)]) { | 1669 @selector(setWantsBestResolutionOpenGLSurface:)]) { |
1666 [self setWantsBestResolutionOpenGLSurface:YES]; | 1670 [self setWantsBestResolutionOpenGLSurface:YES]; |
1667 } | 1671 } |
1668 [[NSNotificationCenter defaultCenter] | 1672 [[NSNotificationCenter defaultCenter] |
1669 addObserver:self | 1673 addObserver:self |
1670 selector:@selector(didChangeScreenParameters:) | 1674 selector:@selector(didChangeScreenParameters:) |
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3320 | 3324 |
3321 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3325 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3322 // regions that are not draggable. (See ControlRegionView in | 3326 // regions that are not draggable. (See ControlRegionView in |
3323 // native_app_window_cocoa.mm). This requires the render host view to be | 3327 // native_app_window_cocoa.mm). This requires the render host view to be |
3324 // draggable by default. | 3328 // draggable by default. |
3325 - (BOOL)mouseDownCanMoveWindow { | 3329 - (BOOL)mouseDownCanMoveWindow { |
3326 return YES; | 3330 return YES; |
3327 } | 3331 } |
3328 | 3332 |
3329 @end | 3333 @end |
OLD | NEW |