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

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

Issue 6955011: Allow site-search to work with --restrict-instant-to-search. (Closed)
Patch Set: With correct base URL Created 9 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 return false; 642 return false;
643 643
644 // Was the host blacklisted? 644 // Was the host blacklisted?
645 if (host_blacklist_ && host_blacklist_->count(match.destination_url.host())) 645 if (host_blacklist_ && host_blacklist_->count(match.destination_url.host()))
646 return false; 646 return false;
647 647
648 const CommandLine* cl = CommandLine::ForCurrentProcess(); 648 const CommandLine* cl = CommandLine::ForCurrentProcess();
649 if (cl->HasSwitch(switches::kRestrictInstantToSearch) && 649 if (cl->HasSwitch(switches::kRestrictInstantToSearch) &&
650 match.type != AutocompleteMatch::SEARCH_WHAT_YOU_TYPED && 650 match.type != AutocompleteMatch::SEARCH_WHAT_YOU_TYPED &&
651 match.type != AutocompleteMatch::SEARCH_HISTORY && 651 match.type != AutocompleteMatch::SEARCH_HISTORY &&
652 match.type != AutocompleteMatch::SEARCH_SUGGEST) { 652 match.type != AutocompleteMatch::SEARCH_SUGGEST &&
653 match.type != AutocompleteMatch::SEARCH_OTHER_ENGINE) {
653 return false; 654 return false;
654 } 655 }
655 656
656 return true; 657 return true;
657 } 658 }
658 659
659 void InstantController::BlacklistFromInstant(TemplateURLID id) { 660 void InstantController::BlacklistFromInstant(TemplateURLID id) {
660 blacklisted_ids_.insert(id); 661 blacklisted_ids_.insert(id);
661 } 662 }
662 663
(...skipping 22 matching lines...) Expand all
685 const AutocompleteMatch& match) { 686 const AutocompleteMatch& match) {
686 const TemplateURL* template_url = match.template_url; 687 const TemplateURL* template_url = match.template_url;
687 if (match.type == AutocompleteMatch::SEARCH_WHAT_YOU_TYPED || 688 if (match.type == AutocompleteMatch::SEARCH_WHAT_YOU_TYPED ||
688 match.type == AutocompleteMatch::SEARCH_HISTORY || 689 match.type == AutocompleteMatch::SEARCH_HISTORY ||
689 match.type == AutocompleteMatch::SEARCH_SUGGEST) { 690 match.type == AutocompleteMatch::SEARCH_SUGGEST) {
690 TemplateURLModel* model = tab_contents_->profile()->GetTemplateURLModel(); 691 TemplateURLModel* model = tab_contents_->profile()->GetTemplateURLModel();
691 template_url = model ? model->GetDefaultSearchProvider() : NULL; 692 template_url = model ? model->GetDefaultSearchProvider() : NULL;
692 } 693 }
693 return template_url; 694 return template_url;
694 } 695 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698