| 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 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace chrome { | 35 namespace chrome { |
| 36 | 36 |
| 37 //////////////////////////////////////////////////////////////////////////////// | 37 //////////////////////////////////////////////////////////////////////////////// |
| 38 // BrowserInstantController, public: | 38 // BrowserInstantController, public: |
| 39 | 39 |
| 40 BrowserInstantController::BrowserInstantController(Browser* browser) | 40 BrowserInstantController::BrowserInstantController(Browser* browser) |
| 41 : browser_(browser), | 41 : browser_(browser), |
| 42 instant_(ALLOW_THIS_IN_INITIALIZER_LIST(this), | 42 instant_(ALLOW_THIS_IN_INITIALIZER_LIST(this), |
| 43 chrome::search::IsInstantExtendedAPIEnabled(browser->profile())), | 43 chrome::search::IsInstantExtendedAPIEnabled(browser->profile()), |
| 44 browser->profile()->IsOffTheRecord()), |
| 44 instant_unload_handler_(browser), | 45 instant_unload_handler_(browser), |
| 45 initialized_theme_info_(false), | 46 initialized_theme_info_(false), |
| 46 theme_area_height_(0) { | 47 theme_area_height_(0) { |
| 47 profile_pref_registrar_.Init(browser_->profile()->GetPrefs()); | 48 profile_pref_registrar_.Init(browser_->profile()->GetPrefs()); |
| 48 profile_pref_registrar_.Add( | 49 profile_pref_registrar_.Add( |
| 49 GetInstantPrefName(browser_->profile()), | 50 GetInstantPrefName(browser_->profile()), |
| 50 base::Bind(&BrowserInstantController::ResetInstant, | 51 base::Bind(&BrowserInstantController::ResetInstant, |
| 51 base::Unretained(this))); | 52 base::Unretained(this))); |
| 52 ResetInstant(); | 53 ResetInstant(); |
| 53 browser_->search_model()->AddObserver(this); | 54 browser_->search_model()->AddObserver(this); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 // part of the image overlay should draw, 'cos the origin is top-left. | 279 // part of the image overlay should draw, 'cos the origin is top-left. |
| 279 if (!browser_->search_model()->mode().is_ntp() || | 280 if (!browser_->search_model()->mode().is_ntp() || |
| 280 theme_info_.theme_id.empty() || | 281 theme_info_.theme_id.empty() || |
| 281 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { | 282 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { |
| 282 return; | 283 return; |
| 283 } | 284 } |
| 284 instant_.ThemeAreaHeightChanged(theme_area_height_); | 285 instant_.ThemeAreaHeightChanged(theme_area_height_); |
| 285 } | 286 } |
| 286 | 287 |
| 287 } // namespace chrome | 288 } // namespace chrome |
| OLD | NEW |