Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 RenderWidgetHostView::RenderWidgetHostView() |
| 19 : popup_type_(WebKit::WebPopupTypeNone), | 19 : popup_type_(WebKit::WebPopupTypeNone), |
| 20 mouse_locked_(false), | 20 mouse_locked_(false), |
| 21 showing_context_menu_(false), | |
| 21 selection_text_offset_(0), | 22 selection_text_offset_(0), |
| 22 selection_range_(ui::Range::InvalidRange()) { | 23 selection_range_(ui::Range::InvalidRange()) { |
| 23 } | 24 } |
| 24 | 25 |
| 25 RenderWidgetHostView::~RenderWidgetHostView() { | 26 RenderWidgetHostView::~RenderWidgetHostView() { |
| 26 DCHECK(!mouse_locked_); | 27 DCHECK(!mouse_locked_); |
| 27 } | 28 } |
| 28 | 29 |
| 29 void RenderWidgetHostView::SetBackground(const SkBitmap& background) { | 30 void RenderWidgetHostView::SetBackground(const SkBitmap& background) { |
| 30 background_ = background; | 31 background_ = background; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 41 } | 42 } |
| 42 | 43 |
| 43 void RenderWidgetHostView::SelectionChanged(const string16& text, | 44 void RenderWidgetHostView::SelectionChanged(const string16& text, |
| 44 size_t offset, | 45 size_t offset, |
| 45 const ui::Range& range) { | 46 const ui::Range& range) { |
| 46 selection_text_ = text; | 47 selection_text_ = text; |
| 47 selection_text_offset_ = offset; | 48 selection_text_offset_ = offset; |
| 48 selection_range_.set_start(range.start()); | 49 selection_range_.set_start(range.start()); |
| 49 selection_range_.set_end(range.end()); | 50 selection_range_.set_end(range.end()); |
| 50 } | 51 } |
| 52 | |
| 53 void RenderWidgetHostView::ShowingContextMenu(bool showing) { | |
|
Ben Goodger (Google)
2012/02/02 19:52:49
It's slightly confusing to have this studlycaps se
Avi (use Gerrit)
2012/02/02 20:02:23
Yep!
| |
| 54 DCHECK_NE(showing_context_menu_, showing); | |
| 55 showing_context_menu_ = showing; | |
| 56 } | |
| OLD | NEW |