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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 void BrowserInstantController::UpdateThemeInfoForPreview() { | 147 void BrowserInstantController::UpdateThemeInfoForPreview() { |
148 // Update theme background info and theme area height. | 148 // Update theme background info and theme area height. |
149 // Initialize |theme_info| if necessary. | 149 // Initialize |theme_info| if necessary. |
150 // |OnThemeChanged| also updates theme area height if necessary. | 150 // |OnThemeChanged| also updates theme area height if necessary. |
151 if (!initialized_theme_info_) | 151 if (!initialized_theme_info_) |
152 OnThemeChanged(ThemeServiceFactory::GetForProfile(browser_->profile())); | 152 OnThemeChanged(ThemeServiceFactory::GetForProfile(browser_->profile())); |
153 else | 153 else |
154 OnThemeChanged(NULL); | 154 OnThemeChanged(NULL); |
155 } | 155 } |
156 | 156 |
157 void BrowserInstantController::OpenURLInCurrentTab(const GURL& url) { | |
158 browser_->OpenURL(content::OpenURLParams( | |
159 url, | |
160 content::Referrer(), | |
samarth
2012/12/07 02:01:35
This is fine for now, but there might be cases whe
Shishir
2012/12/10 20:40:39
Sure. It's easy to add params and maybe we could e
| |
161 CURRENT_TAB, | |
162 content::PAGE_TRANSITION_TYPED, | |
163 //content::PAGE_TRANSITION_FROM_ADDRESS_BAR, | |
samarth
2012/12/07 02:01:35
remove?
Shishir
2012/12/10 20:40:39
Not 100% sure what transition we want to label thi
| |
164 false)); | |
165 } | |
166 | |
157 void BrowserInstantController::ResetInstant() { | 167 void BrowserInstantController::ResetInstant() { |
158 instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile())); | 168 instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile())); |
159 } | 169 } |
160 | 170 |
161 //////////////////////////////////////////////////////////////////////////////// | 171 //////////////////////////////////////////////////////////////////////////////// |
162 // BrowserInstantController, search::SearchModelObserver implementation: | 172 // BrowserInstantController, search::SearchModelObserver implementation: |
163 | 173 |
164 void BrowserInstantController::ModeChanged(const search::Mode& old_mode, | 174 void BrowserInstantController::ModeChanged(const search::Mode& old_mode, |
165 const search::Mode& new_mode) { | 175 const search::Mode& new_mode) { |
166 // If mode is now |NTP|, send theme-related information to instant. | 176 // If mode is now |NTP|, send theme-related information to instant. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 // part of the image overlay should draw, 'cos the origin is top-left. | 281 // part of the image overlay should draw, 'cos the origin is top-left. |
272 if (!browser_->search_model()->mode().is_ntp() || | 282 if (!browser_->search_model()->mode().is_ntp() || |
273 theme_info_.theme_id.empty() || | 283 theme_info_.theme_id.empty() || |
274 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { | 284 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { |
275 return; | 285 return; |
276 } | 286 } |
277 instant_.ThemeAreaHeightChanged(theme_area_height_); | 287 instant_.ThemeAreaHeightChanged(theme_area_height_); |
278 } | 288 } |
279 | 289 |
280 } // namespace chrome | 290 } // namespace chrome |
OLD | NEW |