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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 in_start_(false), | 826 in_start_(false), |
827 profile_(profile) { | 827 profile_(profile) { |
828 search_provider_ = new SearchProvider(this, profile); | 828 search_provider_ = new SearchProvider(this, profile); |
829 providers_.push_back(search_provider_); | 829 providers_.push_back(search_provider_); |
830 // TODO(mrossetti): Remove the following and permanently modify the | 830 // TODO(mrossetti): Remove the following and permanently modify the |
831 // HistoryURLProvider to not search titles once HQP is turned on permanently. | 831 // HistoryURLProvider to not search titles once HQP is turned on permanently. |
832 bool hqp_enabled = !CommandLine::ForCurrentProcess()->HasSwitch( | 832 bool hqp_enabled = !CommandLine::ForCurrentProcess()->HasSwitch( |
833 switches::kDisableHistoryQuickProvider); | 833 switches::kDisableHistoryQuickProvider); |
834 if (hqp_enabled) | 834 if (hqp_enabled) |
835 providers_.push_back(new HistoryQuickProvider(this, profile)); | 835 providers_.push_back(new HistoryQuickProvider(this, profile)); |
836 if (CommandLine::ForCurrentProcess()->HasSwitch( | 836 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
837 switches::kEnableShortcutsProvider)) | 837 switches::kDisableShortcutsProvider)) |
838 providers_.push_back(new ShortcutsProvider(this, profile)); | 838 providers_.push_back(new ShortcutsProvider(this, profile)); |
839 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 839 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
840 switches::kDisableHistoryURLProvider)) | 840 switches::kDisableHistoryURLProvider)) |
841 providers_.push_back(new HistoryURLProvider(this, profile)); | 841 providers_.push_back(new HistoryURLProvider(this, profile)); |
842 keyword_provider_ = new KeywordProvider(this, profile); | 842 keyword_provider_ = new KeywordProvider(this, profile); |
843 providers_.push_back(keyword_provider_); | 843 providers_.push_back(keyword_provider_); |
844 providers_.push_back(new HistoryContentsProvider(this, profile, hqp_enabled)); | 844 providers_.push_back(new HistoryContentsProvider(this, profile, hqp_enabled)); |
845 providers_.push_back(new BuiltinProvider(this, profile)); | 845 providers_.push_back(new BuiltinProvider(this, profile)); |
846 providers_.push_back(new ExtensionAppProvider(this, profile)); | 846 providers_.push_back(new ExtensionAppProvider(this, profile)); |
847 for (ACProviders::iterator i(providers_.begin()); i != providers_.end(); ++i) | 847 for (ACProviders::iterator i(providers_.begin()); i != providers_.end(); ++i) |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 } | 1053 } |
1054 done_ = true; | 1054 done_ = true; |
1055 } | 1055 } |
1056 | 1056 |
1057 void AutocompleteController::StartExpireTimer() { | 1057 void AutocompleteController::StartExpireTimer() { |
1058 if (result_.HasCopiedMatches()) | 1058 if (result_.HasCopiedMatches()) |
1059 expire_timer_.Start(FROM_HERE, | 1059 expire_timer_.Start(FROM_HERE, |
1060 base::TimeDelta::FromMilliseconds(kExpireTimeMS), | 1060 base::TimeDelta::FromMilliseconds(kExpireTimeMS), |
1061 this, &AutocompleteController::ExpireCopiedEntries); | 1061 this, &AutocompleteController::ExpireCopiedEntries); |
1062 } | 1062 } |
OLD | NEW |