| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 const std::vector<ui::LatencyInfo>& all_latency_info) { | 494 const std::vector<ui::LatencyInfo>& all_latency_info) { |
| 495 if (!render_widget_host_) | 495 if (!render_widget_host_) |
| 496 return; | 496 return; |
| 497 for (auto latency_info : all_latency_info) { | 497 for (auto latency_info : all_latency_info) { |
| 498 latency_info.AddLatencyNumber( | 498 latency_info.AddLatencyNumber( |
| 499 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); | 499 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); |
| 500 render_widget_host_->FrameSwapped(latency_info); | 500 render_widget_host_->FrameSwapped(latency_info); |
| 501 } | 501 } |
| 502 } | 502 } |
| 503 | 503 |
| 504 NSView* RenderWidgetHostViewMac::BrowserCompositorSuperview() { | |
| 505 return cocoa_view_; | |
| 506 } | |
| 507 | |
| 508 ui::Layer* RenderWidgetHostViewMac::BrowserCompositorRootLayer() { | |
| 509 return root_layer_.get(); | |
| 510 } | |
| 511 | |
| 512 /////////////////////////////////////////////////////////////////////////////// | 504 /////////////////////////////////////////////////////////////////////////////// |
| 513 // RenderWidgetHostViewBase, public: | 505 // RenderWidgetHostViewBase, public: |
| 514 | 506 |
| 515 // static | 507 // static |
| 516 void RenderWidgetHostViewBase::GetDefaultScreenInfo( | 508 void RenderWidgetHostViewBase::GetDefaultScreenInfo( |
| 517 blink::WebScreenInfo* results) { | 509 blink::WebScreenInfo* results) { |
| 518 *results = GetWebScreenInfo(NULL); | 510 *results = GetWebScreenInfo(NULL); |
| 519 } | 511 } |
| 520 | 512 |
| 521 /////////////////////////////////////////////////////////////////////////////// | 513 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 /////////////////////////////////////////////////////////////////////////////// | 578 /////////////////////////////////////////////////////////////////////////////// |
| 587 // RenderWidgetHostViewMac, RenderWidgetHostView implementation: | 579 // RenderWidgetHostViewMac, RenderWidgetHostView implementation: |
| 588 | 580 |
| 589 void RenderWidgetHostViewMac::EnsureBrowserCompositorView() { | 581 void RenderWidgetHostViewMac::EnsureBrowserCompositorView() { |
| 590 if (browser_compositor_view_) | 582 if (browser_compositor_view_) |
| 591 return; | 583 return; |
| 592 | 584 |
| 593 TRACE_EVENT0("browser", | 585 TRACE_EVENT0("browser", |
| 594 "RenderWidgetHostViewMac::EnsureBrowserCompositorView"); | 586 "RenderWidgetHostViewMac::EnsureBrowserCompositorView"); |
| 595 | 587 |
| 596 browser_compositor_view_.reset(new BrowserCompositorViewMac(this)); | 588 browser_compositor_view_.reset( |
| 589 new BrowserCompositorViewMac(this, cocoa_view_, root_layer_.get())); |
| 597 delegated_frame_host_->AddedToWindow(); | 590 delegated_frame_host_->AddedToWindow(); |
| 598 delegated_frame_host_->WasShown(ui::LatencyInfo()); | 591 delegated_frame_host_->WasShown(ui::LatencyInfo()); |
| 599 } | 592 } |
| 600 | 593 |
| 601 void RenderWidgetHostViewMac::DestroyBrowserCompositorView() { | 594 void RenderWidgetHostViewMac::DestroyBrowserCompositorView() { |
| 602 TRACE_EVENT0("browser", | 595 TRACE_EVENT0("browser", |
| 603 "RenderWidgetHostViewMac::DestroyBrowserCompositorView"); | 596 "RenderWidgetHostViewMac::DestroyBrowserCompositorView"); |
| 604 if (!browser_compositor_view_) | 597 if (!browser_compositor_view_) |
| 605 return; | 598 return; |
| 606 | 599 |
| (...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3319 | 3312 |
| 3320 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3313 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3321 // regions that are not draggable. (See ControlRegionView in | 3314 // regions that are not draggable. (See ControlRegionView in |
| 3322 // native_app_window_cocoa.mm). This requires the render host view to be | 3315 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3323 // draggable by default. | 3316 // draggable by default. |
| 3324 - (BOOL)mouseDownCanMoveWindow { | 3317 - (BOOL)mouseDownCanMoveWindow { |
| 3325 return YES; | 3318 return YES; |
| 3326 } | 3319 } |
| 3327 | 3320 |
| 3328 @end | 3321 @end |
| OLD | NEW |