| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |