Chromium Code Reviews| 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" |
| 11 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/browser_tabstrip.h" | 14 #include "chrome/browser/ui/browser_tabstrip.h" |
| 15 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "chrome/browser/ui/omnibox/location_bar.h" | 16 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 17 #include "chrome/browser/ui/search/search.h" | |
| 18 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 17 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 19 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 20 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 19 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 21 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
| 22 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 23 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
| 24 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 25 | 24 |
| 26 namespace chrome { | 25 namespace chrome { |
| 27 | 26 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 void BrowserInstantController::TabDeactivated(TabContents* contents) { | 164 void BrowserInstantController::TabDeactivated(TabContents* contents) { |
| 166 if (instant()) | 165 if (instant()) |
| 167 instant_->Hide(); | 166 instant_->Hide(); |
| 168 } | 167 } |
| 169 | 168 |
| 170 //////////////////////////////////////////////////////////////////////////////// | 169 //////////////////////////////////////////////////////////////////////////////// |
| 171 // BrowserInstantController, private: | 170 // BrowserInstantController, private: |
| 172 | 171 |
| 173 void BrowserInstantController::ResetInstant() { | 172 void BrowserInstantController::ResetInstant() { |
| 174 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && | 173 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && |
| 175 InstantController::IsEnabled(browser_->profile()) && | 174 browser_->is_type_tabbed()) { |
|
Peter Kasting
2012/08/31 01:51:19
Nit: No {} (2 places).
Another option: Use "XXX ?
sreeram
2012/09/04 17:42:16
Done.
| |
| 176 browser_->is_type_tabbed() && !browser_->profile()->IsOffTheRecord()) { | 175 instant_.reset(InstantController::CreateInstant(browser_->profile(), this)); |
| 177 InstantController::Mode mode = InstantController::INSTANT; | 176 } else { |
| 178 if (chrome::search::IsInstantExtendedAPIEnabled(browser_->profile())) | 177 instant_.reset(); |
| 179 mode = InstantController::EXTENDED; | 178 } |
| 180 instant_.reset(new InstantController(this, mode)); | 179 |
| 180 if (instant()) { | |
| 181 instant_unload_handler_.reset(new InstantUnloadHandler(browser_)); | 181 instant_unload_handler_.reset(new InstantUnloadHandler(browser_)); |
| 182 } else { | 182 } else { |
| 183 instant_.reset(); | |
| 184 instant_unload_handler_.reset(); | 183 instant_unload_handler_.reset(); |
| 185 } | 184 } |
| 186 } | 185 } |
| 187 | 186 |
| 188 } // namespace chrome | 187 } // namespace chrome |
| OLD | NEW |