| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace chrome { | 34 namespace chrome { |
| 35 | 35 |
| 36 //////////////////////////////////////////////////////////////////////////////// | 36 //////////////////////////////////////////////////////////////////////////////// |
| 37 // BrowserInstantController, public: | 37 // BrowserInstantController, public: |
| 38 | 38 |
| 39 BrowserInstantController::BrowserInstantController(Browser* browser) | 39 BrowserInstantController::BrowserInstantController(Browser* browser) |
| 40 : browser_(browser), | 40 : browser_(browser), |
| 41 instant_(ALLOW_THIS_IN_INITIALIZER_LIST(this), | 41 instant_(ALLOW_THIS_IN_INITIALIZER_LIST(this), |
| 42 chrome::search::IsInstantExtendedAPIEnabled(browser->profile())), | 42 chrome::search::IsInstantExtendedAPIEnabled(browser->profile()), |
| 43 browser->profile()->IsOffTheRecord()), |
| 43 instant_unload_handler_(browser), | 44 instant_unload_handler_(browser), |
| 44 initialized_theme_info_(false), | 45 initialized_theme_info_(false), |
| 45 theme_area_height_(0) { | 46 theme_area_height_(0) { |
| 46 profile_pref_registrar_.Init(browser_->profile()->GetPrefs()); | 47 profile_pref_registrar_.Init(browser_->profile()->GetPrefs()); |
| 47 profile_pref_registrar_.Add( | 48 profile_pref_registrar_.Add( |
| 48 GetInstantPrefName(browser_->profile()), | 49 GetInstantPrefName(browser_->profile()), |
| 49 base::Bind(&BrowserInstantController::ResetInstant, | 50 base::Bind(&BrowserInstantController::ResetInstant, |
| 50 base::Unretained(this))); | 51 base::Unretained(this))); |
| 51 ResetInstant(); | 52 ResetInstant(); |
| 52 browser_->search_model()->AddObserver(this); | 53 browser_->search_model()->AddObserver(this); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 // part of the image overlay should draw, 'cos the origin is top-left. | 296 // part of the image overlay should draw, 'cos the origin is top-left. |
| 296 if (!browser_->search_model()->mode().is_ntp() || | 297 if (!browser_->search_model()->mode().is_ntp() || |
| 297 theme_info_.theme_id.empty() || | 298 theme_info_.theme_id.empty() || |
| 298 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { | 299 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { |
| 299 return; | 300 return; |
| 300 } | 301 } |
| 301 instant_.ThemeAreaHeightChanged(theme_area_height_); | 302 instant_.ThemeAreaHeightChanged(theme_area_height_); |
| 302 } | 303 } |
| 303 | 304 |
| 304 } // namespace chrome | 305 } // namespace chrome |
| OLD | NEW |