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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 for (ACProviders::iterator i(providers_.begin()); i != providers_.end(); | 877 for (ACProviders::iterator i(providers_.begin()); i != providers_.end(); |
878 ++i) { | 878 ++i) { |
879 (*i)->Start(input_, minimal_changes); | 879 (*i)->Start(input_, minimal_changes); |
880 if (matches_requested != AutocompleteInput::ALL_MATCHES) | 880 if (matches_requested != AutocompleteInput::ALL_MATCHES) |
881 DCHECK((*i)->done()); | 881 DCHECK((*i)->done()); |
882 } | 882 } |
883 if (matches_requested == AutocompleteInput::ALL_MATCHES && | 883 if (matches_requested == AutocompleteInput::ALL_MATCHES && |
884 (text.length() < 6)) { | 884 (text.length() < 6)) { |
885 base::TimeTicks end_time = base::TimeTicks::Now(); | 885 base::TimeTicks end_time = base::TimeTicks::Now(); |
886 std::string name = "Omnibox.QueryTime." + | 886 std::string name = "Omnibox.QueryTime." + |
887 InstantFieldTrial::GetGroupName(profile_) + | 887 InstantFieldTrial::GetGroupName(profile_) + "." + |
888 base::IntToString(text.length()); | 888 base::IntToString(text.length()); |
889 base::Histogram* counter = base::Histogram::FactoryGet( | 889 base::Histogram* counter = base::Histogram::FactoryGet( |
890 name, 1, 1000, 50, base::Histogram::kUmaTargetedHistogramFlag); | 890 name, 1, 1000, 50, base::Histogram::kUmaTargetedHistogramFlag); |
891 counter->Add(static_cast<int>((end_time - start_time).InMilliseconds())); | 891 counter->Add(static_cast<int>((end_time - start_time).InMilliseconds())); |
892 } | 892 } |
893 in_start_ = false; | 893 in_start_ = false; |
894 CheckIfDone(); | 894 CheckIfDone(); |
895 UpdateResult(true); | 895 UpdateResult(true); |
896 | 896 |
897 if (!done_) | 897 if (!done_) |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 } | 1033 } |
1034 } | 1034 } |
1035 done_ = true; | 1035 done_ = true; |
1036 } | 1036 } |
1037 | 1037 |
1038 void AutocompleteController::StartExpireTimer() { | 1038 void AutocompleteController::StartExpireTimer() { |
1039 if (result_.HasCopiedMatches()) | 1039 if (result_.HasCopiedMatches()) |
1040 expire_timer_.Start(base::TimeDelta::FromMilliseconds(kExpireTimeMS), | 1040 expire_timer_.Start(base::TimeDelta::FromMilliseconds(kExpireTimeMS), |
1041 this, &AutocompleteController::ExpireCopiedEntries); | 1041 this, &AutocompleteController::ExpireCopiedEntries); |
1042 } | 1042 } |
OLD | NEW |