| 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 "content/browser/accessibility/browser_accessibility_manager.h" | 8 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 9 #include "content/browser/gpu/gpu_data_manager_impl.h" | 9 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 10 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" | 10 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 return 0; | 111 return 0; |
| 112 default: | 112 default: |
| 113 break; | 113 break; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 return ::DefWindowProc(window, message, wparam, lparam); | 116 return ::DefWindowProc(window, message, wparam, lparam); |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool IsPluginWrapperWindow(HWND window) { | 119 bool IsPluginWrapperWindow(HWND window) { |
| 120 return gfx::GetClassNameW(window) == | 120 return gfx::GetClassNameW(window) == |
| 121 string16(kWrapperNativeWindowClassName); | 121 base::string16(kWrapperNativeWindowClassName); |
| 122 } | 122 } |
| 123 | 123 |
| 124 // Create an intermediate window between the given HWND and its parent. | 124 // Create an intermediate window between the given HWND and its parent. |
| 125 HWND ReparentWindow(HWND window, HWND parent) { | 125 HWND ReparentWindow(HWND window, HWND parent) { |
| 126 static ATOM atom = 0; | 126 static ATOM atom = 0; |
| 127 static HMODULE instance = NULL; | 127 static HMODULE instance = NULL; |
| 128 if (!atom) { | 128 if (!atom) { |
| 129 WNDCLASSEX window_class; | 129 WNDCLASSEX window_class; |
| 130 base::win::InitializeWindowClass( | 130 base::win::InitializeWindowClass( |
| 131 kWrapperNativeWindowClassName, | 131 kWrapperNativeWindowClassName, |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 gfx::Display display = | 414 gfx::Display display = |
| 415 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); | 415 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); |
| 416 return gfx::ToCeiledSize(gfx::ScaleSize(GetViewBounds().size(), | 416 return gfx::ToCeiledSize(gfx::ScaleSize(GetViewBounds().size(), |
| 417 display.device_scale_factor())); | 417 display.device_scale_factor())); |
| 418 } | 418 } |
| 419 | 419 |
| 420 float RenderWidgetHostViewBase::GetOverdrawBottomHeight() const { | 420 float RenderWidgetHostViewBase::GetOverdrawBottomHeight() const { |
| 421 return 0.f; | 421 return 0.f; |
| 422 } | 422 } |
| 423 | 423 |
| 424 void RenderWidgetHostViewBase::SelectionChanged(const string16& text, | 424 void RenderWidgetHostViewBase::SelectionChanged(const base::string16& text, |
| 425 size_t offset, | 425 size_t offset, |
| 426 const gfx::Range& range) { | 426 const gfx::Range& range) { |
| 427 selection_text_ = text; | 427 selection_text_ = text; |
| 428 selection_text_offset_ = offset; | 428 selection_text_offset_ = offset; |
| 429 selection_range_.set_start(range.start()); | 429 selection_range_.set_start(range.start()); |
| 430 selection_range_.set_end(range.end()); | 430 selection_range_.set_end(range.end()); |
| 431 } | 431 } |
| 432 | 432 |
| 433 bool RenderWidgetHostViewBase::IsShowingContextMenu() const { | 433 bool RenderWidgetHostViewBase::IsShowingContextMenu() const { |
| 434 return showing_context_menu_; | 434 return showing_context_menu_; |
| 435 } | 435 } |
| 436 | 436 |
| 437 void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) { | 437 void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) { |
| 438 DCHECK_NE(showing_context_menu_, showing); | 438 DCHECK_NE(showing_context_menu_, showing); |
| 439 showing_context_menu_ = showing; | 439 showing_context_menu_ = showing; |
| 440 } | 440 } |
| 441 | 441 |
| 442 string16 RenderWidgetHostViewBase::GetSelectedText() const { | 442 base::string16 RenderWidgetHostViewBase::GetSelectedText() const { |
| 443 if (!selection_range_.IsValid()) | 443 if (!selection_range_.IsValid()) |
| 444 return string16(); | 444 return base::string16(); |
| 445 return selection_text_.substr( | 445 return selection_text_.substr( |
| 446 selection_range_.GetMin() - selection_text_offset_, | 446 selection_range_.GetMin() - selection_text_offset_, |
| 447 selection_range_.length()); | 447 selection_range_.length()); |
| 448 } | 448 } |
| 449 | 449 |
| 450 bool RenderWidgetHostViewBase::IsMouseLocked() { | 450 bool RenderWidgetHostViewBase::IsMouseLocked() { |
| 451 return mouse_locked_; | 451 return mouse_locked_; |
| 452 } | 452 } |
| 453 | 453 |
| 454 void RenderWidgetHostViewBase::UnhandledWheelEvent( | 454 void RenderWidgetHostViewBase::UnhandledWheelEvent( |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 void RenderWidgetHostViewBase::FlushInput() { | 586 void RenderWidgetHostViewBase::FlushInput() { |
| 587 RenderWidgetHostImpl* impl = NULL; | 587 RenderWidgetHostImpl* impl = NULL; |
| 588 if (GetRenderWidgetHost()) | 588 if (GetRenderWidgetHost()) |
| 589 impl = RenderWidgetHostImpl::From(GetRenderWidgetHost()); | 589 impl = RenderWidgetHostImpl::From(GetRenderWidgetHost()); |
| 590 if (!impl) | 590 if (!impl) |
| 591 return; | 591 return; |
| 592 impl->FlushInput(); | 592 impl->FlushInput(); |
| 593 } | 593 } |
| 594 | 594 |
| 595 } // namespace content | 595 } // namespace content |
| OLD | NEW |