diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 16:42:25 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 16:42:25 +0000 |
commit | 807bfceada33743cad3308af48c538d7d7515495 (patch) | |
tree | 19953eac8d00695cfbb8c00137d8eb192e0aedc7 /chrome/browser/web_contents_view.h | |
parent | 7b7965f2391594e6a3944ffee8fcdaaf18683fc3 (diff) | |
download | chromium_src-807bfceada33743cad3308af48c538d7d7515495.zip chromium_src-807bfceada33743cad3308af48c538d7d7515495.tar.gz chromium_src-807bfceada33743cad3308af48c538d7d7515495.tar.bz2 |
Move more view stuff out of WebContents. This moves context menus and info
bars. I removed the associated functions on TabContents, and have callers call
directly through to the view when the care about mucking with the info bar
(which is busted, IMO).
Review URL: http://codereview.chromium.org/7245
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_contents_view.h')
-rw-r--r-- | chrome/browser/web_contents_view.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/web_contents_view.h b/chrome/browser/web_contents_view.h index bb28438..29b9368 100644 --- a/chrome/browser/web_contents_view.h +++ b/chrome/browser/web_contents_view.h @@ -14,8 +14,10 @@ class InfoBarView; class RenderViewHost; class RenderWidgetHostHWND; +struct ViewHostMsg_ContextMenu_Params; class WebContents; struct WebDropData; +class WebKeyboardEvent; // The WebContentsView is an interface that is implemented by the platform- // dependent web contents views. The WebContents uses this interface to talk to @@ -61,6 +63,15 @@ class WebContentsView { // Enumerate and 'un-parent' any plugin windows that are children of us. virtual void DetachPluginWindows() = 0; + // Displays the given error in the info bar. A new info bar will be shown if + // one is not shown already. The new error text will replace any existing + // text shown by this same function. + // + // Note: this replacement behavior is historical; crashed plugin and out of + // JS memory used the same message. This seems reasonable, but it may not be + // the best thing for all error messages. + virtual void DisplayErrorInInfoBar(const std::wstring& text) = 0; + // Set/get whether or not the info bar is visible. See also the ChromeFrame // method InfoBarVisibilityChanged and TabContents::IsInfoBarVisible. virtual void SetInfoBarVisible(bool visible) = 0; @@ -68,12 +79,23 @@ class WebContentsView { // Create the InfoBarView and returns it if none has been created. // Just returns existing InfoBarView if it is already created. + // TODO(brettw) this probably shouldn't be here. There should be methods to + // tell us what we need to display instead. virtual InfoBarView* GetInfoBarView() = 0; // The page wants to update the mouse cursor during a drag & drop operation. // |is_drop_target| is true if the mouse is over a valid drop target. virtual void UpdateDragCursor(bool is_drop_target) = 0; + // Runs a context menu with the given parameters from the renderer. + virtual void ShowContextMenu( + const ViewHostMsg_ContextMenu_Params& params) = 0; + + // Posts the given keyboard message and handles it in the native way. This + // is called when the renderer reflects a keyboard message back up to us for + // default handling. + virtual void HandleKeyboardEvent(const WebKeyboardEvent& event) = 0; + protected: WebContentsView() {} // Abstract interface. |