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

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

Issue 2656893003: Let DelegateFrameHost in Mac and Android use correct FrameSinkId during creation (Closed)
Patch Set: more comments Created 3 years, 10 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 <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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 // Paint this view host with |background_color_| when there is no content 462 // Paint this view host with |background_color_| when there is no content
463 // ready to draw. 463 // ready to draw.
464 background_layer_.reset([[CALayer alloc] init]); 464 background_layer_.reset([[CALayer alloc] init]);
465 // Set the default color to be white. This is the wrong thing to do, but many 465 // Set the default color to be white. This is the wrong thing to do, but many
466 // UI components expect this view to be opaque. 466 // UI components expect this view to be opaque.
467 [background_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; 467 [background_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
468 [cocoa_view_ setLayer:background_layer_]; 468 [cocoa_view_ setLayer:background_layer_];
469 [cocoa_view_ setWantsLayer:YES]; 469 [cocoa_view_ setWantsLayer:YES];
470 470
471 browser_compositor_.reset(new BrowserCompositorMac( 471 // GuestViews have two RenderWidgetHostViews and so we need to make sure
472 this, this, render_widget_host_->is_hidden(), [cocoa_view_ window])); 472 // we don't have FrameSinkId collisions.
473 // The FrameSinkId generated here must be unique with FrameSinkId allocated
474 // in ContextFactoryPrivate.
475 // TODO(crbug.com/685777): Centralize allocation in one place for easier
476 // maintenance.
477 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
478 cc::FrameSinkId frame_sink_id =
479 is_guest_view_hack_
480 ? factory->GetContextFactoryPrivate()->AllocateFrameSinkId()
481 : cc::FrameSinkId(base::checked_cast<uint32_t>(
482 render_widget_host_->GetProcess()->GetID()),
483 base::checked_cast<uint32_t>(
484 render_widget_host_->GetRoutingID()));
485 browser_compositor_.reset(
486 new BrowserCompositorMac(this, this, render_widget_host_->is_hidden(),
487 [cocoa_view_ window], frame_sink_id));
473 488
474 display::Screen::GetScreen()->AddObserver(this); 489 display::Screen::GetScreen()->AddObserver(this);
475 490
476 if (!is_guest_view_hack_) 491 if (!is_guest_view_hack_)
477 render_widget_host_->SetView(this); 492 render_widget_host_->SetView(this);
478 493
479 // Let the page-level input event router know about our surface ID 494 // Let the page-level input event router know about our surface ID
480 // namespace for surface-based hit testing. 495 // namespace for surface-based hit testing.
481 if (render_widget_host_->delegate() && 496 if (render_widget_host_->delegate() &&
482 render_widget_host_->delegate()->GetInputEventRouter()) { 497 render_widget_host_->delegate()->GetInputEventRouter()) {
(...skipping 2962 matching lines...) Expand 10 before | Expand all | Expand 10 after
3445 3460
3446 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3461 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3447 // regions that are not draggable. (See ControlRegionView in 3462 // regions that are not draggable. (See ControlRegionView in
3448 // native_app_window_cocoa.mm). This requires the render host view to be 3463 // native_app_window_cocoa.mm). This requires the render host view to be
3449 // draggable by default. 3464 // draggable by default.
3450 - (BOOL)mouseDownCanMoveWindow { 3465 - (BOOL)mouseDownCanMoveWindow {
3451 return YES; 3466 return YES;
3452 } 3467 }
3453 3468
3454 @end 3469 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | ui/android/delegated_frame_host_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698