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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 } | 554 } |
555 | 555 |
556 /////////////////////////////////////////////////////////////////////////////// | 556 /////////////////////////////////////////////////////////////////////////////// |
557 // RenderWidgetHostViewMac, RenderWidgetHostView implementation: | 557 // RenderWidgetHostViewMac, RenderWidgetHostView implementation: |
558 | 558 |
559 bool RenderWidgetHostViewMac::OnMessageReceived(const IPC::Message& message) { | 559 bool RenderWidgetHostViewMac::OnMessageReceived(const IPC::Message& message) { |
560 bool handled = true; | 560 bool handled = true; |
561 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewMac, message) | 561 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewMac, message) |
562 IPC_MESSAGE_HANDLER(ViewMsg_GetRenderedTextCompleted, | 562 IPC_MESSAGE_HANDLER(ViewMsg_GetRenderedTextCompleted, |
563 OnGetRenderedTextCompleted) | 563 OnGetRenderedTextCompleted) |
564 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, | |
565 OnSetNeedsBeginFrames) | |
566 IPC_MESSAGE_UNHANDLED(handled = false) | 564 IPC_MESSAGE_UNHANDLED(handled = false) |
567 IPC_END_MESSAGE_MAP() | 565 IPC_END_MESSAGE_MAP() |
568 return handled; | 566 return handled; |
569 } | 567 } |
570 | 568 |
571 void RenderWidgetHostViewMac::InitAsChild( | 569 void RenderWidgetHostViewMac::InitAsChild( |
572 gfx::NativeView parent_view) { | 570 gfx::NativeView parent_view) { |
573 } | 571 } |
574 | 572 |
575 void RenderWidgetHostViewMac::InitAsPopup( | 573 void RenderWidgetHostViewMac::InitAsPopup( |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 void RenderWidgetHostViewMac::ForwardMouseEvent(const WebMouseEvent& event) { | 1120 void RenderWidgetHostViewMac::ForwardMouseEvent(const WebMouseEvent& event) { |
1123 if (render_widget_host_) | 1121 if (render_widget_host_) |
1124 render_widget_host_->ForwardMouseEvent(event); | 1122 render_widget_host_->ForwardMouseEvent(event); |
1125 | 1123 |
1126 if (event.type == WebInputEvent::MouseLeave) { | 1124 if (event.type == WebInputEvent::MouseLeave) { |
1127 [cocoa_view_ setToolTipAtMousePoint:nil]; | 1125 [cocoa_view_ setToolTipAtMousePoint:nil]; |
1128 tooltip_text_.clear(); | 1126 tooltip_text_.clear(); |
1129 } | 1127 } |
1130 } | 1128 } |
1131 | 1129 |
1132 void RenderWidgetHostViewMac::OnSetNeedsBeginFrames(bool needs_begin_frames) { | 1130 void RenderWidgetHostViewMac::SetNeedsBeginFrames(bool needs_begin_frames) { |
1133 browser_compositor_->SetNeedsBeginFrames(needs_begin_frames); | 1131 browser_compositor_->SetNeedsBeginFrames(needs_begin_frames); |
1134 } | 1132 } |
1135 | 1133 |
1136 void RenderWidgetHostViewMac::KillSelf() { | 1134 void RenderWidgetHostViewMac::KillSelf() { |
1137 if (!weak_factory_.HasWeakPtrs()) { | 1135 if (!weak_factory_.HasWeakPtrs()) { |
1138 [cocoa_view_ setHidden:YES]; | 1136 [cocoa_view_ setHidden:YES]; |
1139 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1137 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1140 FROM_HERE, base::Bind(&RenderWidgetHostViewMac::ShutdownHost, | 1138 FROM_HERE, base::Bind(&RenderWidgetHostViewMac::ShutdownHost, |
1141 weak_factory_.GetWeakPtr())); | 1139 weak_factory_.GetWeakPtr())); |
1142 } | 1140 } |
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3246 | 3244 |
3247 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3245 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3248 // regions that are not draggable. (See ControlRegionView in | 3246 // regions that are not draggable. (See ControlRegionView in |
3249 // native_app_window_cocoa.mm). This requires the render host view to be | 3247 // native_app_window_cocoa.mm). This requires the render host view to be |
3250 // draggable by default. | 3248 // draggable by default. |
3251 - (BOOL)mouseDownCanMoveWindow { | 3249 - (BOOL)mouseDownCanMoveWindow { |
3252 return YES; | 3250 return YES; |
3253 } | 3251 } |
3254 | 3252 |
3255 @end | 3253 @end |
OLD | NEW |