| 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 <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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 445 |
| 446 RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, | 446 RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, |
| 447 bool is_guest_view_hack) | 447 bool is_guest_view_hack) |
| 448 : render_widget_host_(RenderWidgetHostImpl::From(widget)), | 448 : render_widget_host_(RenderWidgetHostImpl::From(widget)), |
| 449 page_at_minimum_scale_(true), | 449 page_at_minimum_scale_(true), |
| 450 is_loading_(false), | 450 is_loading_(false), |
| 451 allow_pause_for_resize_or_repaint_(true), | 451 allow_pause_for_resize_or_repaint_(true), |
| 452 is_guest_view_hack_(is_guest_view_hack), | 452 is_guest_view_hack_(is_guest_view_hack), |
| 453 fullscreen_parent_host_view_(nullptr), | 453 fullscreen_parent_host_view_(nullptr), |
| 454 needs_flush_input_(false), | 454 needs_flush_input_(false), |
| 455 selection_text_offset_(0), |
| 456 selection_range_(gfx::Range::InvalidRange()), |
| 455 weak_factory_(this) { | 457 weak_factory_(this) { |
| 456 // |cocoa_view_| owns us and we will be deleted when |cocoa_view_| | 458 // |cocoa_view_| owns us and we will be deleted when |cocoa_view_| |
| 457 // goes away. Since we autorelease it, our caller must put | 459 // goes away. Since we autorelease it, our caller must put |
| 458 // |GetNativeView()| into the view hierarchy right after calling us. | 460 // |GetNativeView()| into the view hierarchy right after calling us. |
| 459 cocoa_view_ = [[[RenderWidgetHostViewCocoa alloc] | 461 cocoa_view_ = [[[RenderWidgetHostViewCocoa alloc] |
| 460 initWithRenderWidgetHostViewMac:this] autorelease]; | 462 initWithRenderWidgetHostViewMac:this] autorelease]; |
| 461 | 463 |
| 462 // Paint this view host with |background_color_| when there is no content | 464 // Paint this view host with |background_color_| when there is no content |
| 463 // ready to draw. | 465 // ready to draw. |
| 464 background_layer_.reset([[CALayer alloc] init]); | 466 background_layer_.reset([[CALayer alloc] init]); |
| (...skipping 2980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3445 | 3447 |
| 3446 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3448 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3447 // regions that are not draggable. (See ControlRegionView in | 3449 // regions that are not draggable. (See ControlRegionView in |
| 3448 // native_app_window_cocoa.mm). This requires the render host view to be | 3450 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3449 // draggable by default. | 3451 // draggable by default. |
| 3450 - (BOOL)mouseDownCanMoveWindow { | 3452 - (BOOL)mouseDownCanMoveWindow { |
| 3451 return YES; | 3453 return YES; |
| 3452 } | 3454 } |
| 3453 | 3455 |
| 3454 @end | 3456 @end |
| OLD | NEW |