| 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 #include <stdint.h> | 10 #include <stdint.h> |
| 11 | 11 |
| 12 #include <limits> | 12 #include <limits> |
| 13 #include <utility> | 13 #include <utility> |
| 14 | 14 |
| 15 #include "base/bind.h" | 15 #include "base/bind.h" |
| 16 #include "base/callback_helpers.h" | 16 #include "base/callback_helpers.h" |
| 17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 18 #include "base/debug/crash_logging.h" | 18 #include "base/debug/crash_logging.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/mac/scoped_cftyperef.h" | 20 #include "base/mac/scoped_cftyperef.h" |
| 21 #include "base/mac/sdk_forward_declarations.h" |
| 22 #include "base/macros.h" |
| 21 #import "base/mac/scoped_nsobject.h" | 23 #import "base/mac/scoped_nsobject.h" |
| 22 #include "base/mac/sdk_forward_declarations.h" | |
| 23 #include "base/memory/ref_counted.h" | 24 #include "base/memory/ref_counted.h" |
| 24 #include "base/metrics/histogram.h" | 25 #include "base/metrics/histogram.h" |
| 25 #include "base/numerics/safe_conversions.h" | 26 #include "base/numerics/safe_conversions.h" |
| 26 #include "base/strings/string_util.h" | 27 #include "base/strings/string_util.h" |
| 27 #include "base/strings/stringprintf.h" | 28 #include "base/strings/stringprintf.h" |
| 28 #include "base/strings/sys_string_conversions.h" | 29 #include "base/strings/sys_string_conversions.h" |
| 29 #include "base/strings/utf_string_conversions.h" | 30 #include "base/strings/utf_string_conversions.h" |
| 30 #include "base/sys_info.h" | 31 #include "base/sys_info.h" |
| 31 #include "base/threading/thread_task_runner_handle.h" | 32 #include "base/threading/thread_task_runner_handle.h" |
| 32 #include "base/trace_event/trace_event.h" | 33 #include "base/trace_event/trace_event.h" |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 render_widget_host_->SetView(this); | 515 render_widget_host_->SetView(this); |
| 515 | 516 |
| 516 // Let the page-level input event router know about our surface ID | 517 // Let the page-level input event router know about our surface ID |
| 517 // namespace for surface-based hit testing. | 518 // namespace for surface-based hit testing. |
| 518 if (render_widget_host_->delegate() && | 519 if (render_widget_host_->delegate() && |
| 519 render_widget_host_->delegate()->GetInputEventRouter()) { | 520 render_widget_host_->delegate()->GetInputEventRouter()) { |
| 520 render_widget_host_->delegate() | 521 render_widget_host_->delegate() |
| 521 ->GetInputEventRouter() | 522 ->GetInputEventRouter() |
| 522 ->AddSurfaceClientIdOwner(GetSurfaceClientId(), this); | 523 ->AddSurfaceClientIdOwner(GetSurfaceClientId(), this); |
| 523 } | 524 } |
| 525 |
| 526 RenderViewHost* rvh = RenderViewHost::From(render_widget_host_); |
| 527 if (rvh) { |
| 528 // TODO(mostynb): actually use prefs. Landing this as a separate CL |
| 529 // first to rebaseline some unreliable layout tests. |
| 530 ignore_result(rvh->GetWebkitPreferences()); |
| 531 } |
| 524 } | 532 } |
| 525 | 533 |
| 526 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { | 534 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { |
| 527 display::Screen::GetScreen()->RemoveObserver(this); | 535 display::Screen::GetScreen()->RemoveObserver(this); |
| 528 | 536 |
| 529 // This is being called from |cocoa_view_|'s destructor, so invalidate the | 537 // This is being called from |cocoa_view_|'s destructor, so invalidate the |
| 530 // pointer. | 538 // pointer. |
| 531 cocoa_view_ = nil; | 539 cocoa_view_ = nil; |
| 532 | 540 |
| 533 UnlockMouse(); | 541 UnlockMouse(); |
| (...skipping 2693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3227 | 3235 |
| 3228 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3236 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3229 // regions that are not draggable. (See ControlRegionView in | 3237 // regions that are not draggable. (See ControlRegionView in |
| 3230 // native_app_window_cocoa.mm). This requires the render host view to be | 3238 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3231 // draggable by default. | 3239 // draggable by default. |
| 3232 - (BOOL)mouseDownCanMoveWindow { | 3240 - (BOOL)mouseDownCanMoveWindow { |
| 3233 return YES; | 3241 return YES; |
| 3234 } | 3242 } |
| 3235 | 3243 |
| 3236 @end | 3244 @end |
| OLD | NEW |