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

Side by Side Diff: chrome/browser/instant/instant_controller.cc

Issue 6685002: Wires up ability for page to specify instant auto complete (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test and stray char Created 9 years, 9 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/instant/instant_controller.h" 5 #include "chrome/browser/instant/instant_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 381 }
382 382
383 UpdateDisplayableLoader(); 383 UpdateDisplayableLoader();
384 384
385 NotificationService::current()->Notify( 385 NotificationService::current()->Notify(
386 NotificationType::INSTANT_CONTROLLER_SHOWN, 386 NotificationType::INSTANT_CONTROLLER_SHOWN,
387 Source<InstantController>(this), 387 Source<InstantController>(this),
388 NotificationService::NoDetails()); 388 NotificationService::NoDetails());
389 } 389 }
390 390
391 void InstantController::SetSuggestedTextFor(InstantLoader* loader, 391 void InstantController::SetSuggestedTextFor(
392 const string16& text) { 392 InstantLoader* loader,
393 const string16& text,
394 InstantCompleteBehavior behavior) {
393 if (loader_manager_->current_loader() == loader) 395 if (loader_manager_->current_loader() == loader)
394 delegate_->SetSuggestedText(text); 396 delegate_->SetSuggestedText(text, behavior);
395 } 397 }
396 398
397 gfx::Rect InstantController::GetInstantBounds() { 399 gfx::Rect InstantController::GetInstantBounds() {
398 return delegate_->GetInstantBounds(); 400 return delegate_->GetInstantBounds();
399 } 401 }
400 402
401 bool InstantController::ShouldCommitInstantOnMouseUp() { 403 bool InstantController::ShouldCommitInstantOnMouseUp() {
402 return commit_on_mouse_up_; 404 return commit_on_mouse_up_;
403 } 405 }
404 406
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 const AutocompleteMatch& match) { 608 const AutocompleteMatch& match) {
607 const TemplateURL* template_url = match.template_url; 609 const TemplateURL* template_url = match.template_url;
608 if (match.type == AutocompleteMatch::SEARCH_WHAT_YOU_TYPED || 610 if (match.type == AutocompleteMatch::SEARCH_WHAT_YOU_TYPED ||
609 match.type == AutocompleteMatch::SEARCH_HISTORY || 611 match.type == AutocompleteMatch::SEARCH_HISTORY ||
610 match.type == AutocompleteMatch::SEARCH_SUGGEST) { 612 match.type == AutocompleteMatch::SEARCH_SUGGEST) {
611 TemplateURLModel* model = tab_contents_->profile()->GetTemplateURLModel(); 613 TemplateURLModel* model = tab_contents_->profile()->GetTemplateURLModel();
612 template_url = model ? model->GetDefaultSearchProvider() : NULL; 614 template_url = model ? model->GetDefaultSearchProvider() : NULL;
613 } 615 }
614 return template_url; 616 return template_url;
615 } 617 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698