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

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 unit test. 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( 174 void BrowserInstantController::CommitSuggestedText() {
175 bool skip_inline_autocomplete) {
176 browser_->window()->GetLocationBar()->GetLocationEntry()->model()-> 175 browser_->window()->GetLocationBar()->GetLocationEntry()->model()->
177 CommitSuggestedText(skip_inline_autocomplete); 176 CommitSuggestedText();
178 } 177 }
179 178
180 gfx::Rect BrowserInstantController::GetInstantBounds() { 179 gfx::Rect BrowserInstantController::GetInstantBounds() {
181 return browser_->window()->GetInstantBounds(); 180 return browser_->window()->GetInstantBounds();
182 } 181 }
183 182
184 void BrowserInstantController::InstantOverlayFocused() { 183 void BrowserInstantController::InstantOverlayFocused() {
185 // NOTE: This is only invoked on aura. 184 // NOTE: This is only invoked on aura.
186 browser_->window()->WebContentsFocused(instant_.GetOverlayContents()); 185 browser_->window()->WebContentsFocused(instant_.GetOverlayContents());
187 } 186 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 if (!instant_service->IsInstantProcess( 395 if (!instant_service->IsInstantProcess(
397 contents->GetRenderProcessHost()->GetID())) 396 contents->GetRenderProcessHost()->GetID()))
398 continue; 397 continue;
399 398
400 // Reload the contents to ensure that it gets assigned to a non-priviledged 399 // Reload the contents to ensure that it gets assigned to a non-priviledged
401 // renderer. 400 // renderer.
402 contents->GetController().Reload(false); 401 contents->GetController().Reload(false);
403 } 402 }
404 instant_.OnDefaultSearchProviderChanged(); 403 instant_.OnDefaultSearchProviderChanged();
405 } 404 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698