| 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 | 10 |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 // ready to draw. | 545 // ready to draw. |
| 546 background_layer_.reset([[CALayer alloc] init]); | 546 background_layer_.reset([[CALayer alloc] init]); |
| 547 base::ScopedCFTypeRef<CGColorRef> background( | 547 base::ScopedCFTypeRef<CGColorRef> background( |
| 548 gfx::CGColorCreateFromSkColor(background_color_)); | 548 gfx::CGColorCreateFromSkColor(background_color_)); |
| 549 [background_layer_ setBackgroundColor:background]; | 549 [background_layer_ setBackgroundColor:background]; |
| 550 [cocoa_view_ setLayer:background_layer_]; | 550 [cocoa_view_ setLayer:background_layer_]; |
| 551 [cocoa_view_ setWantsLayer:YES]; | 551 [cocoa_view_ setWantsLayer:YES]; |
| 552 | 552 |
| 553 if (IsDelegatedRendererEnabled()) { | 553 if (IsDelegatedRendererEnabled()) { |
| 554 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); | 554 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); |
| 555 delegated_frame_host_.reset(new DelegatedFrameHost(this)); | 555 delegated_frame_host_.reset(new DelegatedFrameHost(this, false)); |
| 556 } | 556 } |
| 557 | 557 |
| 558 gfx::Screen::GetScreenFor(cocoa_view_)->AddObserver(this); | 558 gfx::Screen::GetScreenFor(cocoa_view_)->AddObserver(this); |
| 559 | 559 |
| 560 if (!is_guest_view_hack_) | 560 if (!is_guest_view_hack_) |
| 561 render_widget_host_->SetView(this); | 561 render_widget_host_->SetView(this); |
| 562 } | 562 } |
| 563 | 563 |
| 564 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { | 564 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { |
| 565 gfx::Screen::GetScreenFor(cocoa_view_)->RemoveObserver(this); | 565 gfx::Screen::GetScreenFor(cocoa_view_)->RemoveObserver(this); |
| (...skipping 2867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3433 | 3433 |
| 3434 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3434 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3435 // regions that are not draggable. (See ControlRegionView in | 3435 // regions that are not draggable. (See ControlRegionView in |
| 3436 // native_app_window_cocoa.mm). This requires the render host view to be | 3436 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3437 // draggable by default. | 3437 // draggable by default. |
| 3438 - (BOOL)mouseDownCanMoveWindow { | 3438 - (BOOL)mouseDownCanMoveWindow { |
| 3439 return YES; | 3439 return YES; |
| 3440 } | 3440 } |
| 3441 | 3441 |
| 3442 @end | 3442 @end |
| OLD | NEW |