Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4174)

Unified Diff: chrome/browser/instant/instant_loader.cc

Issue 7880003: content: Move constrained window code from TabContents to TabContentsWrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac regression now that shutdown timing was changed for views. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/instant/instant_loader.cc
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index d0a7d4a60fc44dddae797b928f73c459d5c00361..ee4cae01cf86ff15ae84391855e51c46fef9bde2 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -184,8 +184,6 @@ class InstantLoader::TabContentsDelegateImpl
unsigned changed_flags) OVERRIDE;
virtual void AddNavigationHeaders(const GURL& url,
std::string* headers) OVERRIDE;
- virtual bool ShouldFocusConstrainedWindow() OVERRIDE;
- virtual void WillShowConstrainedWindow(TabContents* source) OVERRIDE;
virtual bool ShouldSuppressDialogs() OVERRIDE;
virtual void BeforeUnloadFired(TabContents* tab,
bool proceed,
@@ -208,6 +206,8 @@ class InstantLoader::TabContentsDelegateImpl
// TabContentsWrapperDelegate:
virtual void SwapTabContents(TabContentsWrapper* old_tc,
TabContentsWrapper* new_tc) OVERRIDE;
+ virtual void WillShowConstrainedWindow(TabContentsWrapper* source) OVERRIDE;
+ virtual bool ShouldFocusConstrainedWindow() OVERRIDE;
// TabContentsObserver:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
@@ -421,23 +421,6 @@ void InstantLoader::TabContentsDelegateImpl::AddNavigationHeaders(
headers);
}
-bool InstantLoader::TabContentsDelegateImpl::ShouldFocusConstrainedWindow() {
- // Return false so that constrained windows are not initially focused. If
- // we did otherwise the preview would prematurely get committed when focus
- // goes to the constrained window.
- return false;
-}
-
-void InstantLoader::TabContentsDelegateImpl::WillShowConstrainedWindow(
- TabContents* source) {
- if (!loader_->ready()) {
- // A constrained window shown for an auth may not paint. Show the preview
- // contents.
- UnregisterForPaintNotifications();
- loader_->ShowPreview();
- }
-}
-
bool InstantLoader::TabContentsDelegateImpl::ShouldSuppressDialogs() {
// Any message shown during instant cancels instant, so we suppress them.
return true;
@@ -504,6 +487,22 @@ void InstantLoader::TabContentsDelegateImpl::SwapTabContents(
loader_->ReplacePreviewContents(old_tc, new_tc);
}
+bool InstantLoader::TabContentsDelegateImpl::ShouldFocusConstrainedWindow() {
+ // Return false so that constrained windows are not initially focused. If
+ // we did otherwise the preview would prematurely get committed when focus
+ // goes to the constrained window.
+ return false;
+}
+
+void InstantLoader::TabContentsDelegateImpl::WillShowConstrainedWindow(
+ TabContentsWrapper* source) {
+ if (!loader_->ready()) {
+ // A constrained window shown for an auth may not paint. Show the preview
+ // contents.
+ UnregisterForPaintNotifications();
+ loader_->ShowPreview();
+ }
+}
bool InstantLoader::TabContentsDelegateImpl::OnMessageReceived(
const IPC::Message& message) {

Powered by Google App Engine
This is Rietveld 408576698