| Index: chrome/browser/tab_contents/tab_contents_delegate.h
|
| diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
|
| index 9f80870bdd534c6e452ae39fb5c89885dcaaed3e..f7eb5e79cea30e76e8c5271de4737c2eb01520e9 100644
|
| --- a/chrome/browser/tab_contents/tab_contents_delegate.h
|
| +++ b/chrome/browser/tab_contents/tab_contents_delegate.h
|
| @@ -83,16 +83,14 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
|
| // 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(TabContents* source);
|
|
|
| // Called to determine if the TabContents is contained in a popup window.
|
| virtual bool IsPopup(TabContents* source) = 0;
|
|
|
| // If |source| is constrained, returns the tab containing it. Otherwise
|
| // returns |source|.
|
| - virtual TabContents* GetConstrainingContents(TabContents* source) {
|
| - return source;
|
| - }
|
| + virtual TabContents* GetConstrainingContents(TabContents* source);
|
|
|
| // Notification that some of our content has changed size as
|
| // part of an animation.
|
| @@ -108,43 +106,43 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
|
| // 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, const gfx::Point& location, bool motion) { }
|
| + TabContents* source, const gfx::Point& location, bool motion);
|
|
|
| // Request the delegate to change the zoom level of the current tab.
|
| - virtual void ContentsZoomChange(bool zoom_in) { }
|
| + virtual void ContentsZoomChange(bool zoom_in);
|
|
|
| // Notifies the delegate that something has changed about what content the
|
| // TabContents is blocking. Interested parties should call
|
| // TabContents::IsContentBlocked() to see if something they care about has
|
| // changed.
|
| - virtual void OnContentSettingsChange(TabContents* source) { }
|
| + virtual void OnContentSettingsChange(TabContents* source);
|
|
|
| // Check whether this contents is inside a window dedicated to running a web
|
| // application.
|
| - virtual bool IsApplication() const { return false; }
|
| + 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) { }
|
| + virtual void ConvertContentsToApplication(TabContents* source);
|
|
|
| // Whether this tab can be blurred through a javascript obj.blur()
|
| // call. ConstrainedWindows shouldn't be able to be blurred.
|
| - virtual bool CanBlur() const { return true; }
|
| + virtual bool CanBlur() const;
|
|
|
| // Whether the specified tab can be reloaded.
|
| // Reloading can be disabled e. g. for the DevTools window.
|
| - virtual bool CanReloadContents(TabContents* source) const { return true; }
|
| + virtual bool CanReloadContents(TabContents* source) const;
|
|
|
| // Return the rect where to display the resize corner, if any, otherwise
|
| // an empty rect.
|
| - virtual gfx::Rect GetRootWindowResizerRect() const { return gfx::Rect(); }
|
| + virtual gfx::Rect GetRootWindowResizerRect() const;
|
|
|
| // Show a dialog with HTML content. |delegate| contains a pointer to the
|
| // delegate who knows how to display the dialog (which file URL and JSON
|
| // string input to use during initialization). |parent_window| is the window
|
| // that should be parent of the dialog, or NULL for the default.
|
| virtual void ShowHtmlDialog(HtmlDialogUIDelegate* delegate,
|
| - gfx::NativeWindow parent_window) { }
|
| + gfx::NativeWindow parent_window);
|
|
|
| // Tells us that we've finished firing this tab's beforeunload event.
|
| // The proceed bool tells us whether the user chose to proceed closing the
|
| @@ -153,82 +151,65 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
|
| // unload events until all the beforeunload events have fired.
|
| virtual void BeforeUnloadFired(TabContents* tab,
|
| bool proceed,
|
| - bool* proceed_to_fire_unload) {
|
| - *proceed_to_fire_unload = true;
|
| - }
|
| + bool* proceed_to_fire_unload);
|
|
|
| // Send IPC to external host. Default implementation is do nothing.
|
| virtual void ForwardMessageToExternalHost(const std::string& message,
|
| const std::string& origin,
|
| - const std::string& target) {
|
| - }
|
| + const std::string& target);
|
|
|
| // If the delegate is hosting tabs externally.
|
| - virtual bool IsExternalTabContainer() const { return false; }
|
| + virtual bool IsExternalTabContainer() const;
|
|
|
| // Sets focus to the location bar or some other place that is appropriate.
|
| // This is called when the tab wants to encourage user input, like for the
|
| // new tab page.
|
| - virtual void SetFocusToLocationBar(bool select_all) {}
|
| + virtual void SetFocusToLocationBar(bool select_all);
|
|
|
| // Called when a popup select is about to be displayed. The delegate can use
|
| // this to disable inactive rendering for the frame in the window the select
|
| // is opened within if necessary.
|
| - virtual void RenderWidgetShowing() {}
|
| + virtual void RenderWidgetShowing();
|
|
|
| // This is used when the contents is an extension that needs to route
|
| // api calls through to the Browser process.
|
| virtual ExtensionFunctionDispatcher* CreateExtensionFunctionDispatcher(
|
| RenderViewHost* render_view_host,
|
| - const std::string& extension_id) {
|
| - return NULL;
|
| - }
|
| + const std::string& extension_id);
|
|
|
| // This is called when webkit tells us that it is done tabbing through
|
| // controls on the page. Provides a way for TabContentsDelegates to handle
|
| // this. Returns true if the delegate successfully handled it.
|
| - virtual bool TakeFocus(bool reverse) {
|
| - return false;
|
| - }
|
| + virtual bool TakeFocus(bool reverse);
|
|
|
| // Changes the blocked state of the tab at |index|. TabContents are
|
| // considered blocked while displaying a tab modal dialog. During that time
|
| // renderer host will ignore any UI interaction within TabContent outside of
|
| // the currently displaying dialog.
|
| - virtual void SetTabContentBlocked(TabContents* contents, bool blocked) { }
|
| + virtual void SetTabContentBlocked(TabContents* contents, bool blocked);
|
|
|
| // Notification that |tab_contents| has gained focus.
|
| - virtual void TabContentsFocused(TabContents* tab_content) { }
|
| + virtual void TabContentsFocused(TabContents* tab_content);
|
|
|
| // Return much extra vertical space should be allotted to the
|
| // render view widget during various animations (e.g. infobar closing).
|
| // This is used to make painting look smoother.
|
| - virtual int GetExtraRenderViewHeight() const {
|
| - return 0;
|
| - }
|
| + virtual int GetExtraRenderViewHeight() const;
|
|
|
| - virtual bool CanDownload(int request_id) {
|
| - return true;
|
| - }
|
| + virtual bool CanDownload(int request_id);
|
|
|
| - virtual void OnStartDownload(DownloadItem* download) {
|
| - }
|
| + virtual void OnStartDownload(DownloadItem* download);
|
|
|
| // Returns true if the context menu operation was handled by the delegate.
|
| - virtual bool HandleContextMenu(const ContextMenuParams& params) {
|
| - return false;
|
| - }
|
| + virtual bool HandleContextMenu(const ContextMenuParams& params);
|
|
|
| // Returns true if the context menu command was handled
|
| - virtual bool ExecuteContextMenuCommand(int command) {
|
| - return false;
|
| - }
|
| + virtual bool ExecuteContextMenuCommand(int command);
|
|
|
| // Shows a confirmation UI that the specified |template_url| is to be added as
|
| // a search engine.
|
| virtual void ConfirmAddSearchProvider(const TemplateURL* template_url,
|
| - Profile* profile) {
|
| - }
|
| + Profile* profile);
|
|
|
| // Shows the page info using the specified information.
|
| // |url| is the url of the page/frame the info applies to, |ssl| is the SSL
|
| @@ -237,67 +218,61 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
|
| virtual void ShowPageInfo(Profile* profile,
|
| const GURL& url,
|
| const NavigationEntry::SSLStatus& ssl,
|
| - bool show_history) {
|
| - }
|
| + bool show_history);
|
|
|
| // Allows delegates to handle keyboard events before sending to the renderer.
|
| // Returns true if the |event| was handled. Otherwise, if the |event| would be
|
| // handled in HandleKeyboardEvent() method as a normal keyboard shortcut,
|
| // |*is_keyboard_shortcut| should be set to true.
|
| virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
|
| - bool* is_keyboard_shortcut) {
|
| - return false;
|
| - }
|
| + bool* is_keyboard_shortcut);
|
|
|
| // Allows delegates to handle unhandled keyboard messages coming back from
|
| // the renderer.
|
| - virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {}
|
| + virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
|
|
|
| // Shows the repost form confirmation dialog box.
|
| - virtual void ShowRepostFormWarningDialog(TabContents* tab_contents) {}
|
| + virtual void ShowRepostFormWarningDialog(TabContents* tab_contents);
|
|
|
| // Shows the Content Settings dialog for a given content type.
|
| - virtual void ShowContentSettingsWindow(ContentSettingsType content_type) {}
|
| + virtual void ShowContentSettingsWindow(ContentSettingsType content_type);
|
|
|
| // Allows delegate to override navigation to the history entries.
|
| // Returns true to allow TabContents to continue with the default processing.
|
| - virtual bool OnGoToEntryOffset(int offset) {
|
| - return true;
|
| - }
|
| + virtual bool OnGoToEntryOffset(int offset);
|
|
|
| // Returns whether this tab contents should add navigations to history.
|
| - virtual bool ShouldAddNavigationsToHistory() const { return true; }
|
| + virtual bool ShouldAddNavigationsToHistory() const;
|
|
|
| // Notification when web app info data is available
|
| virtual void OnDidGetApplicationInfo(TabContents* tab_contents,
|
| - int32 page_id) {
|
| - }
|
| + int32 page_id);
|
|
|
| // Returns the browser in which the tab contents is being displayed.
|
| - virtual Browser* GetBrowser() { return NULL; }
|
| + virtual Browser* GetBrowser();
|
|
|
| // Returns the native window framing the view containing the tab contents.
|
| - virtual gfx::NativeWindow GetFrameNativeWindow() { return NULL; }
|
| + virtual gfx::NativeWindow GetFrameNativeWindow();
|
|
|
| // Notifies the delegate about the creation of a new TabContents. This
|
| // typically happens when popups are created.
|
| - virtual void TabContentsCreated(TabContents* new_contents) {}
|
| + virtual void TabContentsCreated(TabContents* new_contents);
|
|
|
| // Returns whether infobars are enabled. Overrideable by child classes.
|
| - virtual bool infobars_enabled() { return true; }
|
| + virtual bool infobars_enabled();
|
|
|
| // Whether the renderer should report its preferred size when it changes by
|
| // calling UpdatePreferredSize().
|
| // Note that this is set when the RenderViewHost is created and cannot be
|
| // changed after that.
|
| - virtual bool ShouldEnablePreferredSizeNotifications() { return false; }
|
| + virtual bool ShouldEnablePreferredSizeNotifications();
|
|
|
| // Notification that the preferred size of the contents has changed.
|
| // Only called if ShouldEnablePreferredSizeNotifications() returns true.
|
| - virtual void UpdatePreferredSize(const gfx::Size& pref_size) {}
|
| + virtual void UpdatePreferredSize(const gfx::Size& pref_size);
|
|
|
| protected:
|
| - ~TabContentsDelegate() {}
|
| + ~TabContentsDelegate();
|
| };
|
|
|
| #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
|
|
|