| 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_base.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "content/browser/accessibility/browser_accessibility_manager.h" | 9 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 } | 31 } |
| 32 | 32 |
| 33 RenderWidgetHostViewBase::RenderWidgetHostViewBase() | 33 RenderWidgetHostViewBase::RenderWidgetHostViewBase() |
| 34 : is_fullscreen_(false), | 34 : is_fullscreen_(false), |
| 35 popup_type_(blink::kWebPopupTypeNone), | 35 popup_type_(blink::kWebPopupTypeNone), |
| 36 mouse_locked_(false), | 36 mouse_locked_(false), |
| 37 showing_context_menu_(false), | |
| 38 current_device_scale_factor_(0), | 37 current_device_scale_factor_(0), |
| 39 current_display_rotation_(display::Display::ROTATE_0), | 38 current_display_rotation_(display::Display::ROTATE_0), |
| 40 text_input_manager_(nullptr), | 39 text_input_manager_(nullptr), |
| 41 wheel_scroll_latching_enabled_(base::FeatureList::IsEnabled( | 40 wheel_scroll_latching_enabled_(base::FeatureList::IsEnabled( |
| 42 features::kTouchpadAndWheelScrollLatching)), | 41 features::kTouchpadAndWheelScrollLatching)), |
| 43 renderer_frame_number_(0), | 42 renderer_frame_number_(0), |
| 44 weak_factory_(this) {} | 43 weak_factory_(this) {} |
| 45 | 44 |
| 46 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { | 45 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { |
| 47 DCHECK(!mouse_locked_); | 46 DCHECK(!mouse_locked_); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 154 } |
| 156 | 155 |
| 157 void RenderWidgetHostViewBase::CopyFromSurfaceToVideoFrame( | 156 void RenderWidgetHostViewBase::CopyFromSurfaceToVideoFrame( |
| 158 const gfx::Rect& src_rect, | 157 const gfx::Rect& src_rect, |
| 159 scoped_refptr<media::VideoFrame> target, | 158 scoped_refptr<media::VideoFrame> target, |
| 160 const base::Callback<void(const gfx::Rect&, bool)>& callback) { | 159 const base::Callback<void(const gfx::Rect&, bool)>& callback) { |
| 161 NOTIMPLEMENTED(); | 160 NOTIMPLEMENTED(); |
| 162 callback.Run(gfx::Rect(), false); | 161 callback.Run(gfx::Rect(), false); |
| 163 } | 162 } |
| 164 | 163 |
| 165 bool RenderWidgetHostViewBase::IsShowingContextMenu() const { | |
| 166 return showing_context_menu_; | |
| 167 } | |
| 168 | |
| 169 void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) { | |
| 170 DCHECK_NE(showing_context_menu_, showing); | |
| 171 showing_context_menu_ = showing; | |
| 172 } | |
| 173 | |
| 174 base::string16 RenderWidgetHostViewBase::GetSelectedText() { | 164 base::string16 RenderWidgetHostViewBase::GetSelectedText() { |
| 175 if (!GetTextInputManager()) | 165 if (!GetTextInputManager()) |
| 176 return base::string16(); | 166 return base::string16(); |
| 177 return GetTextInputManager()->GetTextSelection(this)->selected_text(); | 167 return GetTextInputManager()->GetTextSelection(this)->selected_text(); |
| 178 } | 168 } |
| 179 | 169 |
| 180 bool RenderWidgetHostViewBase::IsMouseLocked() { | 170 bool RenderWidgetHostViewBase::IsMouseLocked() { |
| 181 return mouse_locked_; | 171 return mouse_locked_; |
| 182 } | 172 } |
| 183 | 173 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 473 |
| 484 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const { | 474 bool RenderWidgetHostViewBase::IsChildFrameForTesting() const { |
| 485 return false; | 475 return false; |
| 486 } | 476 } |
| 487 | 477 |
| 488 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { | 478 cc::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { |
| 489 return cc::SurfaceId(); | 479 return cc::SurfaceId(); |
| 490 } | 480 } |
| 491 | 481 |
| 492 } // namespace content | 482 } // namespace content |
| OLD | NEW |