| OLD | NEW |
| 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/autocomplete/autocomplete.h" | 5 #include "chrome/browser/autocomplete/autocomplete.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 AutocompleteController::AutocompleteController( | 779 AutocompleteController::AutocompleteController( |
| 780 Profile* profile, | 780 Profile* profile, |
| 781 AutocompleteControllerDelegate* delegate) | 781 AutocompleteControllerDelegate* delegate) |
| 782 : delegate_(delegate), | 782 : delegate_(delegate), |
| 783 done_(true), | 783 done_(true), |
| 784 in_start_(false) { | 784 in_start_(false) { |
| 785 search_provider_ = new SearchProvider(this, profile); | 785 search_provider_ = new SearchProvider(this, profile); |
| 786 providers_.push_back(search_provider_); | 786 providers_.push_back(search_provider_); |
| 787 // TODO(mrossetti): Remove the following and permanently modify the | 787 // TODO(mrossetti): Remove the following and permanently modify the |
| 788 // HistoryURLProvider to not search titles once HQP is turned on permanently. | 788 // HistoryURLProvider to not search titles once HQP is turned on permanently. |
| 789 bool hqp_enabled = CommandLine::ForCurrentProcess()->HasSwitch( | 789 bool hqp_enabled = !CommandLine::ForCurrentProcess()->HasSwitch( |
| 790 switches::kEnableHistoryQuickProvider) && | |
| 791 !CommandLine::ForCurrentProcess()->HasSwitch( | |
| 792 switches::kDisableHistoryQuickProvider); | 790 switches::kDisableHistoryQuickProvider); |
| 793 if (hqp_enabled) | 791 if (hqp_enabled) |
| 794 providers_.push_back(new HistoryQuickProvider(this, profile)); | 792 providers_.push_back(new HistoryQuickProvider(this, profile)); |
| 795 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 793 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 796 switches::kDisableHistoryURLProvider)) | 794 switches::kDisableHistoryURLProvider)) |
| 797 providers_.push_back(new HistoryURLProvider(this, profile)); | 795 providers_.push_back(new HistoryURLProvider(this, profile)); |
| 798 providers_.push_back(new KeywordProvider(this, profile)); | 796 providers_.push_back(new KeywordProvider(this, profile)); |
| 799 providers_.push_back(new HistoryContentsProvider(this, profile, hqp_enabled)); | 797 providers_.push_back(new HistoryContentsProvider(this, profile, hqp_enabled)); |
| 800 providers_.push_back(new BuiltinProvider(this, profile)); | 798 providers_.push_back(new BuiltinProvider(this, profile)); |
| 801 providers_.push_back(new ExtensionAppProvider(this, profile)); | 799 providers_.push_back(new ExtensionAppProvider(this, profile)); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 } | 982 } |
| 985 } | 983 } |
| 986 done_ = true; | 984 done_ = true; |
| 987 } | 985 } |
| 988 | 986 |
| 989 void AutocompleteController::StartExpireTimer() { | 987 void AutocompleteController::StartExpireTimer() { |
| 990 if (result_.HasCopiedMatches()) | 988 if (result_.HasCopiedMatches()) |
| 991 expire_timer_.Start(base::TimeDelta::FromMilliseconds(kExpireTimeMS), | 989 expire_timer_.Start(base::TimeDelta::FromMilliseconds(kExpireTimeMS), |
| 992 this, &AutocompleteController::ExpireCopiedEntries); | 990 this, &AutocompleteController::ExpireCopiedEntries); |
| 993 } | 991 } |
| OLD | NEW |