| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 void BrowserInstantController::UpdateThemeInfoForPreview() { | 158 void BrowserInstantController::UpdateThemeInfoForPreview() { |
| 159 // Update theme background info and theme area height. | 159 // Update theme background info and theme area height. |
| 160 // Initialize |theme_info| if necessary. | 160 // Initialize |theme_info| if necessary. |
| 161 // |OnThemeChanged| also updates theme area height if necessary. | 161 // |OnThemeChanged| also updates theme area height if necessary. |
| 162 if (!initialized_theme_info_) | 162 if (!initialized_theme_info_) |
| 163 OnThemeChanged(ThemeServiceFactory::GetForProfile(browser_->profile())); | 163 OnThemeChanged(ThemeServiceFactory::GetForProfile(browser_->profile())); |
| 164 else | 164 else |
| 165 OnThemeChanged(NULL); | 165 OnThemeChanged(NULL); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void BrowserInstantController::OpenURLInCurrentTab( | 168 void BrowserInstantController::OpenURL( |
| 169 const GURL& url, | 169 const GURL& url, |
| 170 content::PageTransition transition) { | 170 content::PageTransition transition, |
| 171 WindowOpenDisposition disposition) { |
| 171 browser_->OpenURL(content::OpenURLParams(url, | 172 browser_->OpenURL(content::OpenURLParams(url, |
| 172 content::Referrer(), | 173 content::Referrer(), |
| 173 CURRENT_TAB, | 174 disposition, |
| 174 transition, | 175 transition, |
| 175 false)); | 176 false)); |
| 176 } | 177 } |
| 177 | 178 |
| 178 void BrowserInstantController::SetMarginSize(int start, int end) { | 179 void BrowserInstantController::SetMarginSize(int start, int end) { |
| 179 instant_.SetMarginSize(start, end); | 180 instant_.SetMarginSize(start, end); |
| 180 } | 181 } |
| 181 | 182 |
| 182 void BrowserInstantController::ResetInstant() { | 183 void BrowserInstantController::ResetInstant() { |
| 183 instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile())); | 184 instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile())); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // part of the image overlay should draw, 'cos the origin is top-left. | 297 // part of the image overlay should draw, 'cos the origin is top-left. |
| 297 if (!browser_->search_model()->mode().is_ntp() || | 298 if (!browser_->search_model()->mode().is_ntp() || |
| 298 theme_info_.theme_id.empty() || | 299 theme_info_.theme_id.empty() || |
| 299 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { | 300 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { |
| 300 return; | 301 return; |
| 301 } | 302 } |
| 302 instant_.ThemeAreaHeightChanged(theme_area_height_); | 303 instant_.ThemeAreaHeightChanged(theme_area_height_); |
| 303 } | 304 } |
| 304 | 305 |
| 305 } // namespace chrome | 306 } // namespace chrome |
| OLD | NEW |