| 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_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 gfx::Size new_size_; | 198 gfx::Size new_size_; |
| 199 scoped_refptr<aura::CompositorLock> compositor_lock_; | 199 scoped_refptr<aura::CompositorLock> compositor_lock_; |
| 200 | 200 |
| 201 DISALLOW_COPY_AND_ASSIGN(ResizeLock); | 201 DISALLOW_COPY_AND_ASSIGN(ResizeLock); |
| 202 }; | 202 }; |
| 203 | 203 |
| 204 //////////////////////////////////////////////////////////////////////////////// | 204 //////////////////////////////////////////////////////////////////////////////// |
| 205 // RenderWidgetHostViewAura, public: | 205 // RenderWidgetHostViewAura, public: |
| 206 | 206 |
| 207 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) | 207 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) |
| 208 : host_(RenderWidgetHostImpl::From(host)), | 208 : RenderWidgetHostViewBase(CompositingDelegateAura(this)), |
| 209 host_(RenderWidgetHostImpl::From(host)), |
| 209 ALLOW_THIS_IN_INITIALIZER_LIST(window_(new aura::Window(this))), | 210 ALLOW_THIS_IN_INITIALIZER_LIST(window_(new aura::Window(this))), |
| 210 in_shutdown_(false), | 211 in_shutdown_(false), |
| 211 is_fullscreen_(false), | 212 is_fullscreen_(false), |
| 212 popup_parent_host_view_(NULL), | 213 popup_parent_host_view_(NULL), |
| 213 popup_child_host_view_(NULL), | 214 popup_child_host_view_(NULL), |
| 214 is_loading_(false), | 215 is_loading_(false), |
| 215 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 216 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), |
| 216 can_compose_inline_(true), | 217 can_compose_inline_(true), |
| 217 has_composition_text_(false), | 218 has_composition_text_(false), |
| 218 current_surface_(0), | 219 current_surface_(0), |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 void RenderWidgetHostViewAura::SetHasHorizontalScrollbar( | 681 void RenderWidgetHostViewAura::SetHasHorizontalScrollbar( |
| 681 bool has_horizontal_scrollbar) { | 682 bool has_horizontal_scrollbar) { |
| 682 // Not needed. Mac-only. | 683 // Not needed. Mac-only. |
| 683 } | 684 } |
| 684 | 685 |
| 685 void RenderWidgetHostViewAura::SetScrollOffsetPinning( | 686 void RenderWidgetHostViewAura::SetScrollOffsetPinning( |
| 686 bool is_pinned_to_left, bool is_pinned_to_right) { | 687 bool is_pinned_to_left, bool is_pinned_to_right) { |
| 687 // Not needed. Mac-only. | 688 // Not needed. Mac-only. |
| 688 } | 689 } |
| 689 | 690 |
| 690 gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() { | |
| 691 ui::Compositor* compositor = GetCompositor(); | |
| 692 if (shared_surface_handle_.is_null() && compositor) { | |
| 693 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | |
| 694 shared_surface_handle_ = factory->CreateSharedSurfaceHandle(compositor); | |
| 695 factory->AddObserver(this); | |
| 696 } | |
| 697 return shared_surface_handle_; | |
| 698 } | |
| 699 | |
| 700 bool RenderWidgetHostViewAura::LockMouse() { | 691 bool RenderWidgetHostViewAura::LockMouse() { |
| 701 aura::RootWindow* root_window = window_->GetRootWindow(); | 692 aura::RootWindow* root_window = window_->GetRootWindow(); |
| 702 if (!root_window) | 693 if (!root_window) |
| 703 return false; | 694 return false; |
| 704 | 695 |
| 705 if (mouse_locked_) | 696 if (mouse_locked_) |
| 706 return true; | 697 return true; |
| 707 | 698 |
| 708 mouse_locked_ = true; | 699 mouse_locked_ = true; |
| 709 window_->SetCapture(); | 700 window_->SetCapture(); |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1413 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1404 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
| 1414 RenderWidgetHost* widget) { | 1405 RenderWidgetHost* widget) { |
| 1415 return new RenderWidgetHostViewAura(widget); | 1406 return new RenderWidgetHostViewAura(widget); |
| 1416 } | 1407 } |
| 1417 | 1408 |
| 1418 // static | 1409 // static |
| 1419 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1410 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 1420 WebKit::WebScreenInfo* results) { | 1411 WebKit::WebScreenInfo* results) { |
| 1421 GetScreenInfoForWindow(results, NULL); | 1412 GetScreenInfoForWindow(results, NULL); |
| 1422 } | 1413 } |
| 1414 |
| 1415 //////////////////////////////////////////////////////////////////////////////// |
| 1416 // CompositingDelegateAura, public: |
| 1417 |
| 1418 gfx::GLSurfaceHandle |
| 1419 RenderWidgetHostViewAura::CompositingDelegateAura::GetCompositingSurface() { |
| 1420 ui::Compositor* compositor = view_->GetCompositor(); |
| 1421 if (view_->shared_surface_handle_.is_null() && compositor) { |
| 1422 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| 1423 view_shared_surface_handle_ = |
| 1424 factory->CreateSharedSurfaceHandle(compositor); |
| 1425 factory->AddObserver(view_); |
| 1426 } |
| 1427 return view_shared_surface_handle_; |
| 1428 } |
| 1429 |
| 1430 bool |
| 1431 renderWidgetHostViewAura::CompositingDelegateAura::ResizeNeedsNewSurface() { |
| 1432 return false; |
| 1433 } |
| OLD | NEW |