| 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 // origin. | 520 // origin. |
| 521 flipped_layer_.reset([[CALayer alloc] init]); | 521 flipped_layer_.reset([[CALayer alloc] init]); |
| 522 [flipped_layer_ setGeometryFlipped:YES]; | 522 [flipped_layer_ setGeometryFlipped:YES]; |
| 523 [flipped_layer_ | 523 [flipped_layer_ |
| 524 setAutoresizingMask:kCALayerWidthSizable|kCALayerHeightSizable]; | 524 setAutoresizingMask:kCALayerWidthSizable|kCALayerHeightSizable]; |
| 525 [background_layer_ addSublayer:flipped_layer_]; | 525 [background_layer_ addSublayer:flipped_layer_]; |
| 526 } | 526 } |
| 527 | 527 |
| 528 if (IsDelegatedRendererEnabled()) { | 528 if (IsDelegatedRendererEnabled()) { |
| 529 root_layer_.reset(new ui::Layer(ui::LAYER_TEXTURED)); | 529 root_layer_.reset(new ui::Layer(ui::LAYER_TEXTURED)); |
| 530 delegated_frame_host_.reset(new DelegatedFrameHost(this)); | 530 delegated_frame_host_.reset(DelegatedFrameHost::Create(this)); |
| 531 } | 531 } |
| 532 | 532 |
| 533 gfx::Screen::GetScreenFor(cocoa_view_)->AddObserver(this); | 533 gfx::Screen::GetScreenFor(cocoa_view_)->AddObserver(this); |
| 534 | 534 |
| 535 render_widget_host_->SetView(this); | 535 render_widget_host_->SetView(this); |
| 536 } | 536 } |
| 537 | 537 |
| 538 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { | 538 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { |
| 539 gfx::Screen::GetScreenFor(cocoa_view_)->RemoveObserver(this); | 539 gfx::Screen::GetScreenFor(cocoa_view_)->RemoveObserver(this); |
| 540 | 540 |
| (...skipping 3469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4010 | 4010 |
| 4011 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 4011 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 4012 // regions that are not draggable. (See ControlRegionView in | 4012 // regions that are not draggable. (See ControlRegionView in |
| 4013 // native_app_window_cocoa.mm). This requires the render host view to be | 4013 // native_app_window_cocoa.mm). This requires the render host view to be |
| 4014 // draggable by default. | 4014 // draggable by default. |
| 4015 - (BOOL)mouseDownCanMoveWindow { | 4015 - (BOOL)mouseDownCanMoveWindow { |
| 4016 return YES; | 4016 return YES; |
| 4017 } | 4017 } |
| 4018 | 4018 |
| 4019 @end | 4019 @end |
| OLD | NEW |