| 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 <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
| 8 #import <objc/runtime.h> | 8 #import <objc/runtime.h> |
| 9 #include <OpenGL/gl.h> | 9 #include <OpenGL/gl.h> |
| 10 #include <QuartzCore/QuartzCore.h> | 10 #include <QuartzCore/QuartzCore.h> |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1614 | 1614 |
| 1615 void RenderWidgetHostViewMac::ShutdownHost() { | 1615 void RenderWidgetHostViewMac::ShutdownHost() { |
| 1616 weak_factory_.InvalidateWeakPtrs(); | 1616 weak_factory_.InvalidateWeakPtrs(); |
| 1617 render_widget_host_->ShutdownAndDestroyWidget(true); | 1617 render_widget_host_->ShutdownAndDestroyWidget(true); |
| 1618 // Do not touch any members at this point, |this| has been deleted. | 1618 // Do not touch any members at this point, |this| has been deleted. |
| 1619 } | 1619 } |
| 1620 | 1620 |
| 1621 void RenderWidgetHostViewMac::SetActive(bool active) { | 1621 void RenderWidgetHostViewMac::SetActive(bool active) { |
| 1622 if (render_widget_host_) { | 1622 if (render_widget_host_) { |
| 1623 render_widget_host_->SetActive(active); | 1623 render_widget_host_->SetActive(active); |
| 1624 if (active) { | |
| 1625 if (HasFocus()) | |
| 1626 render_widget_host_->Focus(); | |
| 1627 } else { | |
| 1628 render_widget_host_->Blur(); | |
| 1629 } | |
| 1630 } | 1624 } |
| 1631 if (HasFocus()) | 1625 if (HasFocus()) |
| 1632 SetTextInputActive(active); | 1626 SetTextInputActive(active); |
| 1633 if (!active) | 1627 if (!active) |
| 1634 UnlockMouse(); | 1628 UnlockMouse(); |
| 1635 } | 1629 } |
| 1636 | 1630 |
| 1637 void RenderWidgetHostViewMac::ShowDefinitionForSelection() { | 1631 void RenderWidgetHostViewMac::ShowDefinitionForSelection() { |
| 1638 RenderWidgetHostViewMacDictionaryHelper helper(this); | 1632 RenderWidgetHostViewMacDictionaryHelper helper(this); |
| 1639 helper.ShowDefinitionForSelection(); | 1633 helper.ShowDefinitionForSelection(); |
| (...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3473 | 3467 |
| 3474 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3468 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3475 // regions that are not draggable. (See ControlRegionView in | 3469 // regions that are not draggable. (See ControlRegionView in |
| 3476 // native_app_window_cocoa.mm). This requires the render host view to be | 3470 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3477 // draggable by default. | 3471 // draggable by default. |
| 3478 - (BOOL)mouseDownCanMoveWindow { | 3472 - (BOOL)mouseDownCanMoveWindow { |
| 3479 return YES; | 3473 return YES; |
| 3480 } | 3474 } |
| 3481 | 3475 |
| 3482 @end | 3476 @end |
| OLD | NEW |