| 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 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/instant/instant_field_trial.h" | 28 #include "chrome/browser/instant/instant_field_trial.h" |
| 29 #include "chrome/browser/net/url_fixer_upper.h" | 29 #include "chrome/browser/net/url_fixer_upper.h" |
| 30 #include "chrome/browser/prefs/pref_service.h" | 30 #include "chrome/browser/prefs/pref_service.h" |
| 31 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| 32 #include "chrome/browser/profiles/profile_io_data.h" | 32 #include "chrome/browser/profiles/profile_io_data.h" |
| 33 #include "chrome/browser/ui/webui/history_ui.h" | 33 #include "chrome/browser/ui/webui/history_ui.h" |
| 34 #include "chrome/common/chrome_notification_types.h" | 34 #include "chrome/common/chrome_notification_types.h" |
| 35 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 36 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
| 37 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
| 38 #include "content/common/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
| 39 #include "googleurl/src/gurl.h" | 39 #include "googleurl/src/gurl.h" |
| 40 #include "googleurl/src/url_canon_ip.h" | 40 #include "googleurl/src/url_canon_ip.h" |
| 41 #include "googleurl/src/url_util.h" | 41 #include "googleurl/src/url_util.h" |
| 42 #include "grit/generated_resources.h" | 42 #include "grit/generated_resources.h" |
| 43 #include "grit/theme_resources.h" | 43 #include "grit/theme_resources.h" |
| 44 #include "net/base/net_util.h" | 44 #include "net/base/net_util.h" |
| 45 #include "net/base/registry_controlled_domain.h" | 45 #include "net/base/registry_controlled_domain.h" |
| 46 #include "net/url_request/url_request.h" | 46 #include "net/url_request/url_request.h" |
| 47 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
| 48 | 48 |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 } else { | 1017 } else { |
| 1018 last_template_url = NULL; | 1018 last_template_url = NULL; |
| 1019 } | 1019 } |
| 1020 } | 1020 } |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 void AutocompleteController::NotifyChanged(bool notify_default_match) { | 1023 void AutocompleteController::NotifyChanged(bool notify_default_match) { |
| 1024 if (delegate_) | 1024 if (delegate_) |
| 1025 delegate_->OnResultChanged(notify_default_match); | 1025 delegate_->OnResultChanged(notify_default_match); |
| 1026 if (done_) { | 1026 if (done_) { |
| 1027 NotificationService::current()->Notify( | 1027 content::NotificationService::current()->Notify( |
| 1028 chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY, | 1028 chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY, |
| 1029 content::Source<AutocompleteController>(this), | 1029 content::Source<AutocompleteController>(this), |
| 1030 NotificationService::NoDetails()); | 1030 content::NotificationService::NoDetails()); |
| 1031 } | 1031 } |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 void AutocompleteController::CheckIfDone() { | 1034 void AutocompleteController::CheckIfDone() { |
| 1035 for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); | 1035 for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); |
| 1036 ++i) { | 1036 ++i) { |
| 1037 if (!(*i)->done()) { | 1037 if (!(*i)->done()) { |
| 1038 done_ = false; | 1038 done_ = false; |
| 1039 return; | 1039 return; |
| 1040 } | 1040 } |
| 1041 } | 1041 } |
| 1042 done_ = true; | 1042 done_ = true; |
| 1043 } | 1043 } |
| 1044 | 1044 |
| 1045 void AutocompleteController::StartExpireTimer() { | 1045 void AutocompleteController::StartExpireTimer() { |
| 1046 if (result_.HasCopiedMatches()) | 1046 if (result_.HasCopiedMatches()) |
| 1047 expire_timer_.Start(FROM_HERE, | 1047 expire_timer_.Start(FROM_HERE, |
| 1048 base::TimeDelta::FromMilliseconds(kExpireTimeMS), | 1048 base::TimeDelta::FromMilliseconds(kExpireTimeMS), |
| 1049 this, &AutocompleteController::ExpireCopiedEntries); | 1049 this, &AutocompleteController::ExpireCopiedEntries); |
| 1050 } | 1050 } |
| OLD | NEW |