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

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: Minor fixes. 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 instant_unload_handler_->RunUnloadListenersOrDestroy(active_tab, index); 117 instant_unload_handler_->RunUnloadListenersOrDestroy(active_tab, index);
118 118
119 GURL url = preview->web_contents()->GetURL(); 119 GURL url = preview->web_contents()->GetURL();
120 DCHECK(browser_->profile()->GetExtensionService()); 120 DCHECK(browser_->profile()->GetExtensionService());
121 if (browser_->profile()->GetExtensionService()->IsInstalledApp(url)) { 121 if (browser_->profile()->GetExtensionService()->IsInstalledApp(url)) {
122 AppLauncherHandler::RecordAppLaunchType( 122 AppLauncherHandler::RecordAppLaunchType(
123 extension_misc::APP_LAUNCH_OMNIBOX_INSTANT); 123 extension_misc::APP_LAUNCH_OMNIBOX_INSTANT);
124 } 124 }
125 } 125 }
126 126
127 void BrowserInstantController::SetInstantPreviewHeight(int height,
128 InstantSizeUnits units) {
129 browser_->window()->SetInstantPreviewHeight(height,
130 units == INSTANT_SIZE_PERCENT);
131 }
132
127 void BrowserInstantController::SetSuggestedText( 133 void BrowserInstantController::SetSuggestedText(
128 const string16& text, 134 const string16& text,
129 InstantCompleteBehavior behavior) { 135 InstantCompleteBehavior behavior) {
130 if (browser_->window()->GetLocationBar()) 136 if (browser_->window()->GetLocationBar())
131 browser_->window()->GetLocationBar()->SetSuggestedText(text, behavior); 137 browser_->window()->GetLocationBar()->SetSuggestedText(text, behavior);
132 } 138 }
133 139
134 gfx::Rect BrowserInstantController::GetInstantBounds() { 140 gfx::Rect BrowserInstantController::GetInstantBounds() {
135 return browser_->window()->GetInstantBounds(); 141 return browser_->window()->GetInstantBounds();
136 } 142 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 void BrowserInstantController::ResetInstant() { 178 void BrowserInstantController::ResetInstant() {
173 instant_.reset( 179 instant_.reset(
174 !browser_shutdown::ShuttingDownWithoutClosingBrowsers() && 180 !browser_shutdown::ShuttingDownWithoutClosingBrowsers() &&
175 browser_->is_type_tabbed() ? 181 browser_->is_type_tabbed() ?
176 InstantController::CreateInstant(browser_->profile(), this) : NULL); 182 InstantController::CreateInstant(browser_->profile(), this) : NULL);
177 instant_unload_handler_.reset(instant() ? 183 instant_unload_handler_.reset(instant() ?
178 new InstantUnloadHandler(browser_) : NULL); 184 new InstantUnloadHandler(browser_) : NULL);
179 } 185 }
180 186
181 } // namespace chrome 187 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698