diff options
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 4 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_delegate.h | 23 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents.cc | 33 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents.h | 7 |
4 files changed, 36 insertions, 31 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index e3cb28d..b23c8d5 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -399,7 +399,7 @@ class TabContents : public PageNavigator, // Removes the InfoBar for the specified |delegate|. void RemoveInfoBar(InfoBarDelegate* delegate); - + // Enumeration and access functions. int infobar_delegate_count() const { return infobar_delegates_.size(); } InfoBarDelegate* GetInfoBarDelegateAt(int index) { @@ -407,7 +407,7 @@ class TabContents : public PageNavigator, } // Toolbars and such --------------------------------------------------------- - + // Returns whether the bookmark bar should be visible. virtual bool IsBookmarkBarAlwaysVisible() { return false; } diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h index 428f98e..05f5e79 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -6,14 +6,10 @@ #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ #include "base/basictypes.h" +#include "base/gfx/rect.h" #include "chrome/browser/tab_contents/page_navigator.h" #include "chrome/common/navigation_types.h" -namespace gfx { -class Point; -class Rect; -} - class TabContents; class HtmlDialogContentsDelegate; @@ -30,8 +26,7 @@ class TabContentsDelegate : public PageNavigator { virtual void OpenURL(const GURL& url, const GURL& referrer, WindowOpenDisposition disposition, - PageTransition::Type transition) - { + PageTransition::Type transition) { OpenURLFromTab(NULL, url, referrer, disposition, transition); } @@ -106,7 +101,7 @@ class TabContentsDelegate : public PageNavigator { // a WebContents with a valid WebApp set. virtual void ConvertContentsToApplication(TabContents* source) { } - // Informs the TabContentsDelegate that some of our state has changed + // Informs the TabContentsDelegate that some of our state has changed // for this tab. virtual void ContentsStateChanged(TabContents* source) {} @@ -119,6 +114,10 @@ class TabContentsDelegate : public PageNavigator { // call. ConstrainedWindows shouldn't be able to be blurred. virtual bool CanBlur() const { return true; } + // Return the rect where to display the resize corner, if any, otherwise + // an empty rect. + virtual gfx::Rect GetRootWindowResizerRect() const { return gfx::Rect(); } + // 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 @@ -129,17 +128,17 @@ class TabContentsDelegate : public PageNavigator { // 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 // 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 + // 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, - bool proceed, - bool* proceed_to_fire_unload) { + bool proceed, + bool* proceed_to_fire_unload) { *proceed_to_fire_unload = true; } // Send IPC to external host. Default implementation is do nothing. virtual void ForwardMessageToExternalHost(const std::string& receiver, - const std::string& message) {}; + const std::string& message) {} // If the delegate is hosting tabs externally. virtual bool IsExternalTabContainer() const { return false; } diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc index ec55a6c..44ab59b 100644 --- a/chrome/browser/tab_contents/web_contents.cc +++ b/chrome/browser/tab_contents/web_contents.cc @@ -394,7 +394,7 @@ bool WebContents::NavigateToPendingEntry(bool reload) { } // Clear any provisional password saves - this stops password infobars - // showing up on pages the user navigates to while the right page is + // showing up on pages the user navigates to while the right page is // loading. GetPasswordManager()->ClearProvisionalSave(); @@ -422,7 +422,7 @@ void WebContents::Copy() { } void WebContents::Paste() { - render_view_host()->Paste(); + render_view_host()->Paste(); } void WebContents::DisassociateFromPopupCount() { @@ -603,7 +603,7 @@ bool WebContents::IsActiveEntry(int32 page_id) { } void WebContents::SetInitialFocus(bool reverse) { - render_view_host()->SetInitialFocus(reverse); + render_view_host()->SetInitialFocus(reverse); } // Notifies the RenderWidgetHost instance about the fact that the page is @@ -670,20 +670,20 @@ void WebContents::DidNavigate(RenderViewHost* rvh, // We can't do anything about navigations when we're inactive. if (!controller() || !is_active()) - return; + return; // Update the site of the SiteInstance if it doesn't have one yet. if (!GetSiteInstance()->has_site()) GetSiteInstance()->SetSite(params.url); - // Need to update MIME type here because it's referred to in + // Need to update MIME type here because it's referred to in // UpdateNavigationCommands() called by RendererDidNavigate() to - // determine whether or not to enable the encoding menu. - // It's updated only for the main frame. For a subframe, + // determine whether or not to enable the encoding menu. + // It's updated only for the main frame. For a subframe, // RenderView::UpdateURL does not set params.contents_mime_type. // (see http://code.google.com/p/chromium/issues/detail?id=2929 ) - // TODO(jungshik): Add a test for the encoding menu to avoid - // regressing it again. + // TODO(jungshik): Add a test for the encoding menu to avoid + // regressing it again. if (PageTransition::IsMainFrame(params.transition)) contents_mime_type_ = params.contents_mime_type; @@ -1049,7 +1049,7 @@ void WebContents::AutofillFormSubmitted( GetAutofillManager()->AutofillFormSubmitted(form); } -void WebContents::GetAutofillSuggestions(const std::wstring& field_name, +void WebContents::GetAutofillSuggestions(const std::wstring& field_name, const std::wstring& user_text, int64 node_id, int request_id) { GetAutofillManager()->FetchValuesForName(field_name, user_text, kMaxAutofillMenuItems, node_id, request_id); @@ -1278,16 +1278,21 @@ bool WebContents::CanBlur() const { return delegate() ? delegate()->CanBlur() : true; } -void WebContents::RendererUnresponsive(RenderViewHost* rvh, +gfx::Rect WebContents::GetRootWindowResizerRect() const { + if (delegate()) + return delegate()->GetRootWindowResizerRect(); + return gfx::Rect(); +} + +void WebContents::RendererUnresponsive(RenderViewHost* rvh, bool is_during_unload) { if (is_during_unload) { // Hang occurred while firing the beforeunload/unload handler. // Pretend the handler fired so tab closing continues as if it had. rvh->UnloadListenerHasFired(); - if (!render_manager_.ShouldCloseTabOnUnresponsiveRenderer()) { + if (!render_manager_.ShouldCloseTabOnUnresponsiveRenderer()) return; - } // If the tab hangs in the beforeunload/unload handler there's really // nothing we can do to recover. Pretend the unload listeners have @@ -1652,7 +1657,7 @@ bool WebContents::UpdateTitleForEntry(NavigationEntry* entry, profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); if (hs) hs->SetPageTitle(entry->display_url(), final_title); - + // Don't allow the title to be saved again for explicitly set ones. received_page_title_ = explicit_set; } diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h index 3326cb1..2f3044b 100644 --- a/chrome/browser/tab_contents/web_contents.h +++ b/chrome/browser/tab_contents/web_contents.h @@ -214,7 +214,7 @@ class WebContents : public TabContents, // Override the encoding and reload the page by sending down // ViewMsg_SetPageEncoding to the renderer. |UpdateEncoding| is kinda - // the opposite of this, by which 'browser' is notified of + // the opposite of this, by which 'browser' is notified of // the encoding of the current tab from 'renderer' (determined by // auto-detect, http header, meta, bom detection, etc). void override_encoding(const std::wstring& encoding) { @@ -308,7 +308,7 @@ class WebContents : public TabContents, IPC::Message* reply_msg); virtual void PasswordFormsSeen(const std::vector<PasswordForm>& forms); virtual void AutofillFormSubmitted(const AutofillForm& form); - virtual void GetAutofillSuggestions(const std::wstring& field_name, + virtual void GetAutofillSuggestions(const std::wstring& field_name, const std::wstring& user_text, int64 node_id, int request_id); virtual void PageHasOSDD(RenderViewHost* render_view_host, int32 page_id, const GURL& url, bool autodetected); @@ -332,7 +332,8 @@ class WebContents : public TabContents, new_request_id); } virtual bool CanBlur() const; - virtual void RendererUnresponsive(RenderViewHost* render_view_host, + virtual gfx::Rect GetRootWindowResizerRect() const; + virtual void RendererUnresponsive(RenderViewHost* render_view_host, bool is_during_unload); virtual void RendererResponsive(RenderViewHost* render_view_host); virtual void LoadStateChanged(const GURL& url, net::LoadState load_state); |