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

Unified Diff: chrome/browser/ui/browser_instant_controller.cc

Issue 10828374: Always call WasShown() before trying to paint. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_instant_controller.cc
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index dc58960c5b0c7f73a66a246cab065c3086828af6..293d9f51325d7e0fbae15bb8dfb9ab3427a26ab1 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -78,6 +78,7 @@ bool BrowserInstantController::OpenInstant(WindowOpenDisposition disposition) {
void BrowserInstantController::ShowInstant() {
TabContents* preview = instant_->GetPreviewContents();
+ preview->web_contents()->WasShown();
sky 2012/08/20 16:29:31 Any reason you're not putting this in InstantContr
sreeram_google.com 2012/08/20 16:36:45 No particular reason. Historically, this code has
sreeram 2012/08/20 16:46:25 I forgot to add that, since the Browser operates o
browser_->window()->ShowInstant(preview);
content::NotificationService::current()->Notify(
@@ -88,10 +89,12 @@ void BrowserInstantController::ShowInstant() {
// TODO(beng): Investigate if we can avoid this and instead rely on the
// visibility of the WebContentsView.
chrome::GetActiveWebContents(browser_)->WasHidden();
- preview->web_contents()->WasShown();
}
void BrowserInstantController::HideInstant() {
+ if (chrome::GetActiveWebContents(browser_))
+ chrome::GetActiveWebContents(browser_)->WasShown();
sky 2012/08/20 16:29:31 How come you're moving this?
sreeram_google.com 2012/08/20 16:36:45 Same reason as before. When we call browser_->wind
+
browser_->window()->HideInstant();
content::NotificationService::current()->Notify(
@@ -99,8 +102,6 @@ void BrowserInstantController::HideInstant() {
content::Source<InstantController>(instant()),
content::NotificationService::NoDetails());
- if (chrome::GetActiveWebContents(browser_))
- chrome::GetActiveWebContents(browser_)->WasShown();
if (TabContents* preview = instant_->GetPreviewContents())
preview->web_contents()->WasHidden();
}
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698