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

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

Issue 15003002: Omnibox refactor. Move StartAutocomplete and DoInstant to controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FIxed NIT Created 7 years, 6 months 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 | Annotate | Revision Log
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_web_ui.h" 10 #include "chrome/browser/extensions/extension_web_ui.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 ReplaceWebContentsAt(index, new_contents.release())); 164 ReplaceWebContentsAt(index, new_contents.release()));
165 instant_unload_handler_.RunUnloadListenersOrDestroy(old_contents.Pass(), 165 instant_unload_handler_.RunUnloadListenersOrDestroy(old_contents.Pass(),
166 index); 166 index);
167 } 167 }
168 168
169 void BrowserInstantController::SetInstantSuggestion( 169 void BrowserInstantController::SetInstantSuggestion(
170 const InstantSuggestion& suggestion) { 170 const InstantSuggestion& suggestion) {
171 browser_->window()->GetLocationBar()->SetInstantSuggestion(suggestion); 171 browser_->window()->GetLocationBar()->SetInstantSuggestion(suggestion);
172 } 172 }
173 173
174 void BrowserInstantController::CommitSuggestedText(
175 bool skip_inline_autocomplete) {
176 browser_->window()->GetLocationBar()->GetLocationEntry()->model()->
177 CommitSuggestedText(skip_inline_autocomplete);
178 }
179
180 gfx::Rect BrowserInstantController::GetInstantBounds() { 174 gfx::Rect BrowserInstantController::GetInstantBounds() {
181 return browser_->window()->GetInstantBounds(); 175 return browser_->window()->GetInstantBounds();
182 } 176 }
183 177
184 void BrowserInstantController::InstantOverlayFocused() { 178 void BrowserInstantController::InstantOverlayFocused() {
185 // NOTE: This is only invoked on aura. 179 // NOTE: This is only invoked on aura.
186 browser_->window()->WebContentsFocused(instant_.GetOverlayContents()); 180 browser_->window()->WebContentsFocused(instant_.GetOverlayContents());
187 } 181 }
188 182
189 void BrowserInstantController::FocusOmnibox(bool caret_visibility) { 183 void BrowserInstantController::FocusOmnibox(bool caret_visibility) {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 if (!instant_service->IsInstantProcess( 390 if (!instant_service->IsInstantProcess(
397 contents->GetRenderProcessHost()->GetID())) 391 contents->GetRenderProcessHost()->GetID()))
398 continue; 392 continue;
399 393
400 // Reload the contents to ensure that it gets assigned to a non-priviledged 394 // Reload the contents to ensure that it gets assigned to a non-priviledged
401 // renderer. 395 // renderer.
402 contents->GetController().Reload(false); 396 contents->GetController().Reload(false);
403 } 397 }
404 instant_.OnDefaultSearchProviderChanged(); 398 instant_.OnDefaultSearchProviderChanged();
405 } 399 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.h ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698