Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: chrome/browser/ui/browser_instant_controller.cc

Issue 11466007: Add new IPC for searchbox to pipe SearchBox NavigateContentWindow calls to the browser. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: No longer commit on SearchBoxNavigate IPC. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void BrowserInstantController::UpdateThemeInfoForPreview() { 154 void BrowserInstantController::UpdateThemeInfoForPreview() {
155 // Update theme background info and theme area height. 155 // Update theme background info and theme area height.
156 // Initialize |theme_info| if necessary. 156 // Initialize |theme_info| if necessary.
157 // |OnThemeChanged| also updates theme area height if necessary. 157 // |OnThemeChanged| also updates theme area height if necessary.
158 if (!initialized_theme_info_) 158 if (!initialized_theme_info_)
159 OnThemeChanged(ThemeServiceFactory::GetForProfile(browser_->profile())); 159 OnThemeChanged(ThemeServiceFactory::GetForProfile(browser_->profile()));
160 else 160 else
161 OnThemeChanged(NULL); 161 OnThemeChanged(NULL);
162 } 162 }
163 163
164 void BrowserInstantController::OpenURLInCurrentTab(const GURL& url) {
165 browser_->OpenURL(content::OpenURLParams(
166 url,
167 content::Referrer(),
168 CURRENT_TAB,
169 content::PAGE_TRANSITION_TYPED,
sky 2012/12/12 00:09:21 Why is this typed, and should the referrer be set?
Shishir 2012/12/12 00:48:28 We talked about this and said we dont want to set
sky 2012/12/12 04:11:19 Omnibox also uses PAGE_TRANSITION_GENERATED. Which
samarth 2012/12/12 16:32:27 The searchbox code has access to InstantAutocomple
Shishir 2012/12/12 20:04:47 Done.
Shishir 2012/12/12 20:04:47 Done.
170 false));
171 }
172
164 void BrowserInstantController::ResetInstant() { 173 void BrowserInstantController::ResetInstant() {
165 instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile())); 174 instant_.SetInstantEnabled(IsInstantEnabled(browser_->profile()));
166 } 175 }
167 176
168 //////////////////////////////////////////////////////////////////////////////// 177 ////////////////////////////////////////////////////////////////////////////////
169 // BrowserInstantController, search::SearchModelObserver implementation: 178 // BrowserInstantController, search::SearchModelObserver implementation:
170 179
171 void BrowserInstantController::ModeChanged(const search::Mode& old_mode, 180 void BrowserInstantController::ModeChanged(const search::Mode& old_mode,
172 const search::Mode& new_mode) { 181 const search::Mode& new_mode) {
173 // If mode is now |NTP|, send theme-related information to instant. 182 // If mode is now |NTP|, send theme-related information to instant.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // part of the image overlay should draw, 'cos the origin is top-left. 287 // part of the image overlay should draw, 'cos the origin is top-left.
279 if (!browser_->search_model()->mode().is_ntp() || 288 if (!browser_->search_model()->mode().is_ntp() ||
280 theme_info_.theme_id.empty() || 289 theme_info_.theme_id.empty() ||
281 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) { 290 theme_info_.image_vertical_alignment == THEME_BKGRND_IMAGE_ALIGN_TOP) {
282 return; 291 return;
283 } 292 }
284 instant_.ThemeAreaHeightChanged(theme_area_height_); 293 instant_.ThemeAreaHeightChanged(theme_area_height_);
285 } 294 }
286 295
287 } // namespace chrome 296 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698