diff options
Diffstat (limited to 'content/public/browser/web_contents_delegate.h')
-rw-r--r-- | content/public/browser/web_contents_delegate.h | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index e2fef31..1426c65 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -56,7 +56,7 @@ namespace content { struct OpenURLParams; // Objects implement this interface to get notified about changes in the -// TabContents and to provide necessary functionality. +// WebContents and to provide necessary functionality. class CONTENT_EXPORT WebContentsDelegate { public: WebContentsDelegate(); @@ -76,35 +76,35 @@ class CONTENT_EXPORT WebContentsDelegate { // Called to inform the delegate that the tab content's navigation state // changed. The |changed_flags| indicates the parts of the navigation state // that have been updated, and is any combination of the - // |TabContents::InvalidateTypes| bits. - virtual void NavigationStateChanged(const TabContents* source, + // |WebContents::InvalidateTypes| bits. + virtual void NavigationStateChanged(const WebContents* source, unsigned changed_flags) {} // Adds the navigation request headers to |headers|. Use // net::HttpUtil::AppendHeaderIfMissing to build the set of headers. virtual void AddNavigationHeaders(const GURL& url, std::string* headers) {} - // Creates a new tab with the already-created TabContents 'new_contents'. + // Creates a new tab with the already-created WebContents 'new_contents'. // The window for the added contents should be reparented correctly when this // method returns. If |disposition| is NEW_POPUP, |pos| should hold the // initial position. - virtual void AddNewContents(TabContents* source, - TabContents* new_contents, + virtual void AddNewContents(WebContents* source, + WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) {} // Selects the specified contents, bringing its container to the front. - virtual void ActivateContents(TabContents* contents) {} + virtual void ActivateContents(WebContents* contents) {} // Deactivates the specified contents by deactivating its container and // potentialy moving it to the back of the Z order. - virtual void DeactivateContents(TabContents* contents) {} + virtual void DeactivateContents(WebContents* contents) {} // Notifies the delegate that this contents is starting or is done loading // some resource. The delegate should use this notification to represent - // loading feedback. See TabContents::IsLoading() - virtual void LoadingStateChanged(TabContents* source) {} + // loading feedback. See WebContents::IsLoading() + virtual void LoadingStateChanged(WebContents* source) {} // Notifies the delegate that the page has made some progress loading. // |progress| is a value between 0.0 (nothing loaded) to 1.0 (page fully @@ -113,36 +113,36 @@ class CONTENT_EXPORT WebContentsDelegate { // SetReportLoadProgressEnabled(true) in the render view. virtual void LoadProgressChanged(double progress) {} - // Request the delegate to close this tab contents, and do whatever cleanup + // Request the delegate to close this web contents, and do whatever cleanup // it needs to do. virtual void CloseContents(WebContents* source) {} // Informs the delegate that the underlying RenderViewHost has been swapped // out so it can perform any cleanup necessary. - virtual void SwappedOut(TabContents* source) {} + virtual void SwappedOut(WebContents* source) {} // Request the delegate to move this tab contents to the specified position // in screen coordinates. - virtual void MoveContents(TabContents* source, const gfx::Rect& pos) {} + virtual void MoveContents(WebContents* source, const gfx::Rect& pos) {} // Causes the delegate to detach |source| and clean up any internal data // pointing to it. After this call ownership of |source| passes to the // caller, and it is safe to call "source->set_delegate(someone_else);". - virtual void DetachContents(TabContents* source) {} + virtual void DetachContents(WebContents* source) {} - // Called to determine if the TabContents is contained in a popup window + // Called to determine if the WebContents is contained in a popup window // or a panel window. - virtual bool IsPopupOrPanel(const TabContents* source) const; + virtual bool IsPopupOrPanel(const WebContents* source) const; // Notification that the target URL has changed. - virtual void UpdateTargetURL(TabContents* source, + virtual void UpdateTargetURL(WebContents* source, int32 page_id, const GURL& url) {} // Notification that there was a mouse event, along with the absolute // coordinates of the mouse pointer and whether it was a normal motion event // (otherwise, the pointer left the contents area). - virtual void ContentsMouseEvent(TabContents* source, + virtual void ContentsMouseEvent(WebContents* source, const gfx::Point& location, bool motion) {} @@ -154,12 +154,12 @@ class CONTENT_EXPORT WebContentsDelegate { virtual bool IsApplication() const; // Detach the given tab and convert it to a "webapp" view. The tab must be - // a TabContents with a valid WebApp set. - virtual void ConvertContentsToApplication(TabContents* source) {} + // a WebContents with a valid WebApp set. + virtual void ConvertContentsToApplication(WebContents* source) {} // Whether the specified tab can be reloaded. // Reloading can be disabled e. g. for the DevTools window. - virtual bool CanReloadContents(TabContents* source) const; + virtual bool CanReloadContents(WebContents* source) const; // Invoked prior to showing before unload handler confirmation dialog. virtual void WillRunBeforeUnloadConfirm() {} @@ -173,7 +173,7 @@ class CONTENT_EXPORT WebContentsDelegate { // tab. Returns true if the tab can continue on firing it's unload event. // If we're closing the entire browser, then we'll want to delay firing // unload events until all the beforeunload events have fired. - virtual void BeforeUnloadFired(TabContents* tab, + virtual void BeforeUnloadFired(WebContents* tab, bool proceed, bool* proceed_to_fire_unload); @@ -199,14 +199,14 @@ class CONTENT_EXPORT WebContentsDelegate { // Invoked when the page loses mouse capture. virtual void LostCapture() {} - // Notification that |tab_contents| has gained focus. - virtual void TabContentsFocused(TabContents* tab_content) {} + // Notification that |contents| has gained focus. + virtual void WebContentsFocused(WebContents* contents) {} // Asks the delegate if the given tab can download. - virtual bool CanDownload(TabContents* source, int request_id); + virtual bool CanDownload(WebContents* source, int request_id); // Notifies the delegate that a download is starting. - virtual void OnStartDownload(TabContents* source, DownloadItem* download) {} + virtual void OnStartDownload(WebContents* source, DownloadItem* download) {} // Return much extra vertical space should be allotted to the // render view widget during various animations (e.g. infobar closing). @@ -230,10 +230,10 @@ class CONTENT_EXPORT WebContentsDelegate { // Opens source view for given tab contents that is navigated to the given // page url. - virtual void ViewSourceForTab(TabContents* source, const GURL& page_url); + virtual void ViewSourceForTab(WebContents* source, const GURL& page_url); // Opens source view for the given subframe. - virtual void ViewSourceForFrame(TabContents* source, + virtual void ViewSourceForFrame(WebContents* source, const GURL& url, const std::string& content_state); @@ -256,10 +256,10 @@ class CONTENT_EXPORT WebContentsDelegate { virtual void DragEnded() {} // Shows the repost form confirmation dialog box. - virtual void ShowRepostFormWarningDialog(TabContents* tab_contents) {} + virtual void ShowRepostFormWarningDialog(WebContents* source) {} // Allows delegate to override navigation to the history entries. - // Returns true to allow TabContents to continue with the default processing. + // Returns true to allow WebContents to continue with the default processing. virtual bool OnGoToEntryOffset(int offset); // Returns whether this tab contents should add the specified navigation to @@ -271,30 +271,30 @@ class CONTENT_EXPORT WebContentsDelegate { // Returns the native window framing the view containing the tab contents. virtual gfx::NativeWindow GetFrameNativeWindow(); - // Notifies the delegate about the creation of a new TabContents. This + // Notifies the delegate about the creation of a new WebContents. This // typically happens when popups are created. - virtual void TabContentsCreated(TabContents* new_contents) {} + virtual void WebContentsCreated(WebContents* new_contents) {} // Notifies the delegate that the content restrictions for this tab has // changed. - virtual void ContentRestrictionsChanged(TabContents* source) {} + virtual void ContentRestrictionsChanged(WebContents* source) {} // Notification that the tab is hung. - virtual void RendererUnresponsive(TabContents* source) {} + virtual void RendererUnresponsive(WebContents* source) {} // Notification that the tab is no longer hung. - virtual void RendererResponsive(TabContents* source) {} + virtual void RendererResponsive(WebContents* source) {} // Notification that a worker associated with this tab has crashed. - virtual void WorkerCrashed(TabContents* source) {} + virtual void WorkerCrashed(WebContents* source) {} // Invoked when a main fram navigation occurs. - virtual void DidNavigateMainFramePostCommit(TabContents* tab) {} + virtual void DidNavigateMainFramePostCommit(WebContents* tab) {} // Invoked when navigating to a pending entry. When invoked the // NavigationController has configured its pending entry, but it has not yet // been committed. - virtual void DidNavigateToPendingEntry(TabContents* tab) {} + virtual void DidNavigateToPendingEntry(WebContents* tab) {} // Returns a pointer to a service to create JavaScript dialogs. The default // pointer returned is to a stub service that marks all dialogs as suppressed @@ -302,32 +302,32 @@ class CONTENT_EXPORT WebContentsDelegate { virtual JavaScriptDialogCreator* GetJavaScriptDialogCreator(); // Called when a file selection is to be done. - virtual void RunFileChooser(TabContents* tab, + virtual void RunFileChooser(WebContents* tab, const FileChooserParams& params) {} // Request to enumerate a directory. This is equivalent to running the file // chooser in directory-enumeration mode and having the user select the given // directory. - virtual void EnumerateDirectory(TabContents* tab, + virtual void EnumerateDirectory(WebContents* tab, int request_id, const FilePath& path) {} // Called when the renderer puts a tab into or out of fullscreen mode. - virtual void ToggleFullscreenModeForTab(TabContents* tab, + virtual void ToggleFullscreenModeForTab(WebContents* tab, bool enter_fullscreen) {} - virtual bool IsFullscreenForTab(const TabContents* tab) const; + virtual bool IsFullscreenForTab(const WebContents* tab) const; // Called when a Javascript out of memory notification is received. - virtual void JSOutOfMemory(TabContents* tab) {} + virtual void JSOutOfMemory(WebContents* tab) {} // Register a new handler for URL requests with the given scheme. - virtual void RegisterProtocolHandler(TabContents* tab, + virtual void RegisterProtocolHandler(WebContents* tab, const std::string& protocol, const GURL& url, const string16& title) {} // Register a new handler for Intents with the given action and type filter. - virtual void RegisterIntentHandler(TabContents* tab, + virtual void RegisterIntentHandler(WebContents* tab, const string16& action, const string16& type, const string16& href, @@ -336,13 +336,13 @@ class CONTENT_EXPORT WebContentsDelegate { // Web Intents notification handler. Takes ownership of the // |intents_dispatcher|. - virtual void WebIntentDispatch(TabContents* tab, + virtual void WebIntentDispatch(WebContents* tab, WebIntentsDispatcher* intents_dispatcher); // Result of string search in the page. This includes the number of matches // found and the selection rect (in screen coordinates) for the string found. // If |final_update| is false, it indicates that more results follow. - virtual void FindReply(TabContents* tab, + virtual void FindReply(WebContents* tab, int request_id, int number_of_matches, const gfx::Rect& selection_rect, @@ -350,14 +350,14 @@ class CONTENT_EXPORT WebContentsDelegate { bool final_update) {} // Notification that a plugin has crashed. - virtual void CrashedPlugin(TabContents* tab, const FilePath& plugin_path) {} + virtual void CrashedPlugin(WebContents* tab, const FilePath& plugin_path) {} // Invoked when the preferred size of the contents has been changed. - virtual void UpdatePreferredSize(TabContents* tab, + virtual void UpdatePreferredSize(WebContents* tab, const gfx::Size& pref_size) {} // Notification message from HTML UI. - virtual void WebUISend(TabContents* tab, + virtual void WebUISend(WebContents* tab, const GURL& source_url, const std::string& name, const base::ListValue& args) {} @@ -365,7 +365,7 @@ class CONTENT_EXPORT WebContentsDelegate { // Requests to lock the mouse. Once the request is approved or rejected, // GotResponseToLockMouseRequest() will be called on the requesting tab // contents. - virtual void RequestToLockMouse(TabContents* tab) {} + virtual void RequestToLockMouse(WebContents* tab) {} // Notification that the page has lost the mouse lock. virtual void LostMouseLock() {} @@ -377,13 +377,13 @@ class CONTENT_EXPORT WebContentsDelegate { friend class ::TabContents; // Called when |this| becomes the WebContentsDelegate for |source|. - void Attach(TabContents* source); + void Attach(WebContents* source); // Called when |this| is no longer the WebContentsDelegate for |source|. - void Detach(TabContents* source); + void Detach(WebContents* source); - // The TabContents that this is currently a delegate for. - std::set<TabContents*> attached_contents_; + // The WebContents that this is currently a delegate for. + std::set<WebContents*> attached_contents_; }; } // namespace content |