summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_view.h
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 04:08:59 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 04:08:59 +0000
commit60c42a8c7b44171abc3f8a58d0f69a923ead2bbd (patch)
tree692a0162b6843c3ce0c95448274fdc8e50667766 /chrome/renderer/render_view.h
parente7634aa3ea26c84026b8eb0abfc0bdee3e753f6a (diff)
downloadchromium_src-60c42a8c7b44171abc3f8a58d0f69a923ead2bbd.zip
chromium_src-60c42a8c7b44171abc3f8a58d0f69a923ead2bbd.tar.gz
chromium_src-60c42a8c7b44171abc3f8a58d0f69a923ead2bbd.tar.bz2
Eliminate WebView::GetDelegate and replace RenderViewSet with a map from
WebView to RenderView. R=mpcomplete BUG=10033 TEST=none Review URL: http://codereview.chromium.org/265044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.h')
-rw-r--r--chrome/renderer/render_view.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index e11a8e1..babe495 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -5,6 +5,7 @@
#ifndef CHROME_RENDERER_RENDER_VIEW_H_
#define CHROME_RENDERER_RENDER_VIEW_H_
+#include <map>
#include <set>
#include <string>
#include <queue>
@@ -31,6 +32,7 @@
#include "chrome/renderer/external_host_bindings.h"
#include "chrome/renderer/notification_provider.h"
#include "chrome/renderer/render_widget.h"
+#include "chrome/renderer/render_view_visitor.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
#include "webkit/api/public/WebConsoleMessage.h"
@@ -111,9 +113,12 @@ class RenderView : public RenderWidget,
public webkit_glue::DomSerializerDelegate,
public base::SupportsWeakPtr<RenderView> {
public:
- struct RenderViewSet {
- std::set<RenderView*> render_view_set_;
- };
+ // Visit all RenderViews with a live WebView (i.e., RenderViews that have
+ // been closed but not yet destroyed are excluded).
+ static void ForEach(RenderViewVisitor* visitor);
+
+ // Returns the RenderView containing the given WebView.
+ static RenderView* FromWebView(WebView* webview);
// Creates a new RenderView. The parent_hwnd specifies a HWND to use as the
// parent of the WebView HWND that will be created. If this is a constrained
@@ -431,12 +436,11 @@ class RenderView : public RenderWidget,
bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
protected:
- // RenderWidget override.
+ // RenderWidget overrides:
+ virtual void Close();
virtual void OnResize(const gfx::Size& new_size,
const gfx::Rect& resizer_rect);
- // RenderWidget override
virtual void DidPaint();
- // RenderWidget override.
virtual void DidHandleKeyEvent();
private:
@@ -810,6 +814,10 @@ class RenderView : public RenderWidget,
// same page twice in a row.
int32 last_indexed_page_id_;
+ // The next available page ID to use. This ensures that the page IDs are
+ // globally unique in the renderer.
+ static int32 next_page_id_;
+
// Used for popups.
bool opened_by_user_gesture_;
GURL creator_url_;
@@ -982,6 +990,7 @@ class RenderView : public RenderWidget,
typedef std::set<webkit_glue::ImageResourceFetcher*> ImageResourceFetcherSet;
ImageResourceFetcherSet image_fetchers_;
+ typedef std::map<WebView*, RenderView*> ViewMap;
DISALLOW_COPY_AND_ASSIGN(RenderView);
};