Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_base.h |
| diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1b45295278f3ec1e676793f71a35589a76a9dc73 |
| --- /dev/null |
| +++ b/content/browser/renderer_host/render_widget_host_view_base.h |
| @@ -0,0 +1,99 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
jam
2012/02/15 17:02:19
can you svn copy this, or the equivalent under git
Jói
2012/02/16 12:41:42
As discussed off-line, this is hard because of the
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| +#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| +#pragma once |
| + |
| +#if defined(OS_MACOSX) |
| +#include <OpenGL/OpenGL.h> |
| +#endif |
| + |
| +#if defined(TOOLKIT_USES_GTK) |
| +#include <gdk/gdk.h> |
| +#endif |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/callback_forward.h" |
| +#include "content/common/content_export.h" |
| +#include "content/port/browser/render_widget_host_view_port.h" |
| +#include "ui/base/range/range.h" |
| + |
| +namespace content { |
| + |
| +// Basic implementation shared by concrete RenderWidgetHostView |
| +// subclasses. |
| +// |
| +// Note that nothing should use this class, except concrete subclasses |
| +// that are deriving from it, and code that is written specifically to |
| +// use one of these concrete subclasses (i.e. platform-specific code). |
| +// |
| +// To enable embedders that add ports, everything else in content/ |
| +// should use the RenderWidgetHostViewPort interface. |
| +class CONTENT_EXPORT RenderWidgetHostViewBase |
| + : public RenderWidgetHostViewPort { |
| + public: |
| + virtual ~RenderWidgetHostViewBase(); |
| + |
| + // RenderWidgetHostViewPort implementation. |
| + virtual void SelectionChanged(const string16& text, |
| + size_t offset, |
| + const ui::Range& range) OVERRIDE; |
| + virtual void SetBackground(const SkBitmap& background) OVERRIDE; |
| + virtual const SkBitmap& GetBackground() OVERRIDE; |
| + virtual bool IsShowingContextMenu() const OVERRIDE; |
| + virtual void SetShowingContextMenu(bool) OVERRIDE; |
|
jam
2012/02/15 17:02:19
nit: didn't see this before, we should have a para
Jói
2012/02/16 12:41:42
Done.
|
| + virtual BrowserAccessibilityManager* |
| + GetBrowserAccessibilityManager() const OVERRIDE; |
| + virtual bool IsMouseLocked() OVERRIDE; |
| + virtual void SetPopupType(WebKit::WebPopupType popup_type) OVERRIDE; |
| + virtual WebKit::WebPopupType GetPopupType() OVERRIDE; |
| + |
| + void SetBrowserAccessibilityManager(BrowserAccessibilityManager* manager); |
| + |
| + protected: |
| + // Interface class only, do not construct. |
| + RenderWidgetHostViewBase(); |
| + |
| + // Whether this view is a popup and what kind of popup it is (select, |
| + // autofill...). |
| + WebKit::WebPopupType popup_type_; |
| + |
| + // A custom background to paint behind the web content. This will be tiled |
| + // horizontally. Can be null, in which case we fall back to painting white. |
| + SkBitmap background_; |
| + |
| + // While the mouse is locked, the cursor is hidden from the user. Mouse events |
| + // are still generated. However, the position they report is the last known |
| + // mouse position just as mouse lock was entered; the movement they report |
| + // indicates what the change in position of the mouse would be had it not been |
| + // locked. |
| + bool mouse_locked_; |
| + |
| + // Whether we are showing a context menu. |
| + bool showing_context_menu_; |
| + |
| + // A buffer containing the text inside and around the current selection range. |
| + string16 selection_text_; |
| + |
| + // The offset of the text stored in |selection_text_| relative to the start of |
| + // the web page. |
| + size_t selection_text_offset_; |
| + |
| + // The current selection range relative to the start of the web page. |
| + ui::Range selection_range_; |
| + |
| + private: |
| + // Manager of the tree representation of the WebKit render tree. |
| + scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |