Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_base.cc

Issue 9347042: Introduce content::RenderWidgetHostViewPort (in content/port/browser). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // static
21 RenderWidgetHostViewPort* RenderWidgetHostViewPort::FromRWHV(
22 RenderWidgetHostView* rwhv) {
23 return static_cast<RenderWidgetHostViewPort*>(rwhv);
19 } 24 }
20 25
21 RenderWidgetHostView::~RenderWidgetHostView() { 26 // static
27 RenderWidgetHostViewPort* RenderWidgetHostViewPort::CreateViewForWidget(
28 RenderWidgetHost* widget) {
29 return FromRWHV(RenderWidgetHostView::CreateViewForWidget(widget));
22 } 30 }
23 31
24 RenderWidgetHostViewBase::RenderWidgetHostViewBase() 32 RenderWidgetHostViewBase::RenderWidgetHostViewBase()
25 : popup_type_(WebKit::WebPopupTypeNone), 33 : popup_type_(WebKit::WebPopupTypeNone),
26 mouse_locked_(false), 34 mouse_locked_(false),
27 showing_context_menu_(false), 35 showing_context_menu_(false),
28 selection_text_offset_(0), 36 selection_text_offset_(0),
29 selection_range_(ui::Range::InvalidRange()) { 37 selection_range_(ui::Range::InvalidRange()) {
30 } 38 }
31 39
32 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { 40 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() {
33 DCHECK(!mouse_locked_); 41 DCHECK(!mouse_locked_);
34 } 42 }
35 43
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) { 44 void RenderWidgetHostViewBase::SetBackground(const SkBitmap& background) {
49 background_ = background; 45 background_ = background;
50 } 46 }
51 47
52 const SkBitmap& RenderWidgetHostViewBase::GetBackground() { 48 const SkBitmap& RenderWidgetHostViewBase::GetBackground() {
53 return background_; 49 return background_;
54 } 50 }
55 51
56 BrowserAccessibilityManager* 52 BrowserAccessibilityManager*
57 RenderWidgetHostViewBase::GetBrowserAccessibilityManager() const { 53 RenderWidgetHostViewBase::GetBrowserAccessibilityManager() const {
(...skipping 15 matching lines...) Expand all
73 } 69 }
74 70
75 bool RenderWidgetHostViewBase::IsShowingContextMenu() const { 71 bool RenderWidgetHostViewBase::IsShowingContextMenu() const {
76 return showing_context_menu_; 72 return showing_context_menu_;
77 } 73 }
78 74
79 void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) { 75 void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) {
80 DCHECK_NE(showing_context_menu_, showing); 76 DCHECK_NE(showing_context_menu_, showing);
81 showing_context_menu_ = showing; 77 showing_context_menu_ = showing;
82 } 78 }
79
80 bool RenderWidgetHostViewBase::IsMouseLocked() {
81 return mouse_locked_;
82 }
83
84 void RenderWidgetHostViewBase::SetPopupType(WebKit::WebPopupType popup_type) {
85 popup_type_ = popup_type;
86 }
87
88 WebKit::WebPopupType RenderWidgetHostViewBase::GetPopupType() {
89 return popup_type_;
90 }
91
92 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698