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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2242613003: Hoist SetNeedsBeginFrame messages up to the RWHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix redundant set needs begin frames Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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
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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 void RenderWidgetHostViewMac::ForwardMouseEvent(const WebMouseEvent& event) { 1118 void RenderWidgetHostViewMac::ForwardMouseEvent(const WebMouseEvent& event) {
1121 if (render_widget_host_) 1119 if (render_widget_host_)
1122 render_widget_host_->ForwardMouseEvent(event); 1120 render_widget_host_->ForwardMouseEvent(event);
1123 1121
1124 if (event.type == WebInputEvent::MouseLeave) { 1122 if (event.type == WebInputEvent::MouseLeave) {
1125 [cocoa_view_ setToolTipAtMousePoint:nil]; 1123 [cocoa_view_ setToolTipAtMousePoint:nil];
1126 tooltip_text_.clear(); 1124 tooltip_text_.clear();
1127 } 1125 }
1128 } 1126 }
1129 1127
1130 void RenderWidgetHostViewMac::OnSetNeedsBeginFrames(bool needs_begin_frames) { 1128 void RenderWidgetHostViewMac::SetNeedsBeginFrames(bool needs_begin_frames) {
1131 browser_compositor_->SetNeedsBeginFrames(needs_begin_frames); 1129 browser_compositor_->SetNeedsBeginFrames(needs_begin_frames);
1132 } 1130 }
1133 1131
1134 void RenderWidgetHostViewMac::KillSelf() { 1132 void RenderWidgetHostViewMac::KillSelf() {
1135 if (!weak_factory_.HasWeakPtrs()) { 1133 if (!weak_factory_.HasWeakPtrs()) {
1136 [cocoa_view_ setHidden:YES]; 1134 [cocoa_view_ setHidden:YES];
1137 base::ThreadTaskRunnerHandle::Get()->PostTask( 1135 base::ThreadTaskRunnerHandle::Get()->PostTask(
1138 FROM_HERE, base::Bind(&RenderWidgetHostViewMac::ShutdownHost, 1136 FROM_HERE, base::Bind(&RenderWidgetHostViewMac::ShutdownHost,
1139 weak_factory_.GetWeakPtr())); 1137 weak_factory_.GetWeakPtr()));
1140 } 1138 }
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3244 3242
3245 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3243 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3246 // regions that are not draggable. (See ControlRegionView in 3244 // regions that are not draggable. (See ControlRegionView in
3247 // native_app_window_cocoa.mm). This requires the render host view to be 3245 // native_app_window_cocoa.mm). This requires the render host view to be
3248 // draggable by default. 3246 // draggable by default.
3249 - (BOOL)mouseDownCanMoveWindow { 3247 - (BOOL)mouseDownCanMoveWindow {
3250 return YES; 3248 return YES;
3251 } 3249 }
3252 3250
3253 @end 3251 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698