| 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 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 2708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2719 return; | 2719 return; |
| 2720 | 2720 |
| 2721 if ([[self window] firstResponder] == self) | 2721 if ([[self window] firstResponder] == self) |
| 2722 renderWidgetHostView_->SetActive(false); | 2722 renderWidgetHostView_->SetActive(false); |
| 2723 } | 2723 } |
| 2724 | 2724 |
| 2725 - (BOOL)becomeFirstResponder { | 2725 - (BOOL)becomeFirstResponder { |
| 2726 if (!renderWidgetHostView_->render_widget_host_) | 2726 if (!renderWidgetHostView_->render_widget_host_) |
| 2727 return NO; | 2727 return NO; |
| 2728 | 2728 |
| 2729 renderWidgetHostView_->render_widget_host_->Focus(); | 2729 renderWidgetHostView_->render_widget_host_->GotFocus(); |
| 2730 renderWidgetHostView_->SetTextInputActive(true); | 2730 renderWidgetHostView_->SetTextInputActive(true); |
| 2731 | 2731 |
| 2732 // Cancel any onging composition text which was left before we lost focus. | 2732 // Cancel any onging composition text which was left before we lost focus. |
| 2733 // TODO(suzhe): We should do it in -resignFirstResponder: method, but | 2733 // TODO(suzhe): We should do it in -resignFirstResponder: method, but |
| 2734 // somehow that method won't be called when switching among different tabs. | 2734 // somehow that method won't be called when switching among different tabs. |
| 2735 // See http://crbug.com/47209 | 2735 // See http://crbug.com/47209 |
| 2736 [self cancelComposition]; | 2736 [self cancelComposition]; |
| 2737 | 2737 |
| 2738 NSNumber* direction = [NSNumber numberWithUnsignedInteger: | 2738 NSNumber* direction = [NSNumber numberWithUnsignedInteger: |
| 2739 [[self window] keyViewSelectionDirection]]; | 2739 [[self window] keyViewSelectionDirection]]; |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3436 | 3436 |
| 3437 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3437 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3438 // regions that are not draggable. (See ControlRegionView in | 3438 // regions that are not draggable. (See ControlRegionView in |
| 3439 // native_app_window_cocoa.mm). This requires the render host view to be | 3439 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3440 // draggable by default. | 3440 // draggable by default. |
| 3441 - (BOOL)mouseDownCanMoveWindow { | 3441 - (BOOL)mouseDownCanMoveWindow { |
| 3442 return YES; | 3442 return YES; |
| 3443 } | 3443 } |
| 3444 | 3444 |
| 3445 @end | 3445 @end |
| OLD | NEW |