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

Side by Side Diff: chrome/browser/ui/browser_instant_controller.cc

Issue 10915217: Hook up SetInstantPreviewHeight for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move height to ShowPreview. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser_instant_controller.h" 5 #include "chrome/browser/ui/browser_instant_controller.h"
6 6
7 #include "chrome/browser/browser_shutdown.h" 7 #include "chrome/browser/browser_shutdown.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/instant/instant_controller.h" 9 #include "chrome/browser/instant/instant_controller.h"
10 #include "chrome/browser/instant/instant_unload_handler.h" 10 #include "chrome/browser/instant/instant_unload_handler.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // The omnibox currently doesn't use other dispositions, so we don't attempt 70 // The omnibox currently doesn't use other dispositions, so we don't attempt
71 // to handle them. If you hit this NOTREACHED file a bug and I'll (sky) add 71 // to handle them. If you hit this NOTREACHED file a bug and I'll (sky) add
72 // support for the new disposition. 72 // support for the new disposition.
73 NOTREACHED(); 73 NOTREACHED();
74 return false; 74 return false;
75 } 75 }
76 76
77 //////////////////////////////////////////////////////////////////////////////// 77 ////////////////////////////////////////////////////////////////////////////////
78 // BrowserInstantController, InstantControllerDelegate implementation: 78 // BrowserInstantController, InstantControllerDelegate implementation:
79 79
80 void BrowserInstantController::ShowInstant() { 80 void BrowserInstantController::ShowInstant(int height, InstantSizeUnits units) {
81 // Call ShowInstant() first, before WasShown(), so that the preview is added 81 // Call ShowInstant() first, before WasShown(), so that the preview is added
82 // to the window hierarchy before it's painted. http://crbug.com/145568 82 // to the window hierarchy before it's painted. http://crbug.com/145568
83 TabContents* preview = instant_->GetPreviewContents(); 83 TabContents* preview = instant_->GetPreviewContents();
84 browser_->window()->ShowInstant(preview); 84 browser_->window()->ShowInstant(preview, height, units);
85 85
86 // TODO(beng): Investigate if we can avoid this and instead rely on the 86 // TODO(beng): Investigate if we can avoid this and instead rely on the
87 // visibility of the WebContentsView. 87 // visibility of the WebContentsView.
88 preview->web_contents()->WasShown(); 88 preview->web_contents()->WasShown();
89 chrome::GetActiveWebContents(browser_)->WasHidden(); 89 chrome::GetActiveWebContents(browser_)->WasHidden();
90 90
91 content::NotificationService::current()->Notify( 91 content::NotificationService::current()->Notify(
92 chrome::NOTIFICATION_INSTANT_CONTROLLER_SHOWN, 92 chrome::NOTIFICATION_INSTANT_CONTROLLER_SHOWN,
93 content::Source<InstantController>(instant()), 93 content::Source<InstantController>(instant()),
94 content::NotificationService::NoDetails()); 94 content::NotificationService::NoDetails());
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void BrowserInstantController::ResetInstant() { 173 void BrowserInstantController::ResetInstant() {
174 instant_.reset( 174 instant_.reset(
175 !browser_shutdown::ShuttingDownWithoutClosingBrowsers() && 175 !browser_shutdown::ShuttingDownWithoutClosingBrowsers() &&
176 browser_->is_type_tabbed() ? 176 browser_->is_type_tabbed() ?
177 InstantController::CreateInstant(browser_->profile(), this) : NULL); 177 InstantController::CreateInstant(browser_->profile(), this) : NULL);
178 instant_unload_handler_.reset(instant() ? 178 instant_unload_handler_.reset(instant() ?
179 new InstantUnloadHandler(browser_) : NULL); 179 new InstantUnloadHandler(browser_) : NULL);
180 } 180 }
181 181
182 } // namespace chrome 182 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698