| 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.h" | 5 #include "content/browser/renderer_host/render_widget_host_view.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 "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
| 10 | 10 |
| 11 #if defined(TOOLKIT_USES_GTK) | 11 #if defined(TOOLKIT_USES_GTK) |
| 12 #include <gdk/gdkx.h> | 12 #include <gdk/gdkx.h> |
| 13 #include <gtk/gtk.h> | 13 #include <gtk/gtk.h> |
| 14 | 14 |
| 15 #include "content/browser/renderer_host/gtk_window_utils.h" | 15 #include "content/browser/renderer_host/gtk_window_utils.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 RenderWidgetHostView::RenderWidgetHostView() { | 18 namespace content { |
| 19 } | |
| 20 | |
| 21 RenderWidgetHostView::~RenderWidgetHostView() { | |
| 22 } | |
| 23 | 19 |
| 24 RenderWidgetHostViewBase::RenderWidgetHostViewBase() | 20 RenderWidgetHostViewBase::RenderWidgetHostViewBase() |
| 25 : popup_type_(WebKit::WebPopupTypeNone), | 21 : popup_type_(WebKit::WebPopupTypeNone), |
| 26 mouse_locked_(false), | 22 mouse_locked_(false), |
| 27 showing_context_menu_(false), | 23 showing_context_menu_(false), |
| 28 selection_text_offset_(0), | 24 selection_text_offset_(0), |
| 29 selection_range_(ui::Range::InvalidRange()) { | 25 selection_range_(ui::Range::InvalidRange()) { |
| 30 } | 26 } |
| 31 | 27 |
| 32 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { | 28 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { |
| 33 DCHECK(!mouse_locked_); | 29 DCHECK(!mouse_locked_); |
| 34 } | 30 } |
| 35 | 31 |
| 36 // static | |
| 37 RenderWidgetHostViewBase* RenderWidgetHostViewBase::FromRWHV( | |
| 38 RenderWidgetHostView* rwhv) { | |
| 39 return static_cast<RenderWidgetHostViewBase*>(rwhv); | |
| 40 } | |
| 41 | |
| 42 // static | |
| 43 RenderWidgetHostViewBase* RenderWidgetHostViewBase::CreateViewForWidget( | |
| 44 RenderWidgetHost* widget) { | |
| 45 return FromRWHV(RenderWidgetHostView::CreateViewForWidget(widget)); | |
| 46 } | |
| 47 | |
| 48 void RenderWidgetHostViewBase::SetBackground(const SkBitmap& background) { | 32 void RenderWidgetHostViewBase::SetBackground(const SkBitmap& background) { |
| 49 background_ = background; | 33 background_ = background; |
| 50 } | 34 } |
| 51 | 35 |
| 52 const SkBitmap& RenderWidgetHostViewBase::GetBackground() { | 36 const SkBitmap& RenderWidgetHostViewBase::GetBackground() { |
| 53 return background_; | 37 return background_; |
| 54 } | 38 } |
| 55 | 39 |
| 56 BrowserAccessibilityManager* | 40 BrowserAccessibilityManager* |
| 57 RenderWidgetHostViewBase::GetBrowserAccessibilityManager() const { | 41 RenderWidgetHostViewBase::GetBrowserAccessibilityManager() const { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 73 } | 57 } |
| 74 | 58 |
| 75 bool RenderWidgetHostViewBase::IsShowingContextMenu() const { | 59 bool RenderWidgetHostViewBase::IsShowingContextMenu() const { |
| 76 return showing_context_menu_; | 60 return showing_context_menu_; |
| 77 } | 61 } |
| 78 | 62 |
| 79 void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) { | 63 void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) { |
| 80 DCHECK_NE(showing_context_menu_, showing); | 64 DCHECK_NE(showing_context_menu_, showing); |
| 81 showing_context_menu_ = showing; | 65 showing_context_menu_ = showing; |
| 82 } | 66 } |
| 67 |
| 68 bool RenderWidgetHostViewBase::IsMouseLocked() { |
| 69 return mouse_locked_; |
| 70 } |
| 71 |
| 72 void RenderWidgetHostViewBase::SetPopupType(WebKit::WebPopupType popup_type) { |
| 73 popup_type_ = popup_type; |
| 74 } |
| 75 |
| 76 WebKit::WebPopupType RenderWidgetHostViewBase::GetPopupType() { |
| 77 return popup_type_; |
| 78 } |
| 79 |
| 80 } // namespace content |
| OLD | NEW |