| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" | 
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" | 
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 802     if (synchronous_only) | 802     if (synchronous_only) | 
| 803       DCHECK((*i)->done()); | 803       DCHECK((*i)->done()); | 
| 804   } | 804   } | 
| 805   CheckIfDone(); | 805   CheckIfDone(); | 
| 806   UpdateLatestResult(true); | 806   UpdateLatestResult(true); | 
| 807 } | 807 } | 
| 808 | 808 | 
| 809 void AutocompleteController::Stop(bool clear_result) { | 809 void AutocompleteController::Stop(bool clear_result) { | 
| 810   for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); | 810   for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); | 
| 811        ++i) { | 811        ++i) { | 
| 812     if (!(*i)->done()) | 812     (*i)->Stop(); | 
| 813       (*i)->Stop(); |  | 
| 814   } | 813   } | 
| 815 | 814 | 
| 816   update_delay_timer_.Stop(); | 815   update_delay_timer_.Stop(); | 
| 817   updated_latest_result_ = false; | 816   updated_latest_result_ = false; | 
| 818   delay_interval_has_passed_ = false; | 817   delay_interval_has_passed_ = false; | 
| 819   done_ = true; | 818   done_ = true; | 
| 820   if (clear_result && !result_.empty()) { | 819   if (clear_result && !result_.empty()) { | 
| 821     result_.Reset(); | 820     result_.Reset(); | 
| 822     NotificationService::current()->Notify( | 821     NotificationService::current()->Notify( | 
| 823         NotificationType::AUTOCOMPLETE_CONTROLLER_RESULT_UPDATED, | 822         NotificationType::AUTOCOMPLETE_CONTROLLER_RESULT_UPDATED, | 
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1023 void AutocompleteController::CheckIfDone() { | 1022 void AutocompleteController::CheckIfDone() { | 
| 1024   for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); | 1023   for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); | 
| 1025        ++i) { | 1024        ++i) { | 
| 1026     if (!(*i)->done()) { | 1025     if (!(*i)->done()) { | 
| 1027       done_ = false; | 1026       done_ = false; | 
| 1028       return; | 1027       return; | 
| 1029     } | 1028     } | 
| 1030   } | 1029   } | 
| 1031   done_ = true; | 1030   done_ = true; | 
| 1032 } | 1031 } | 
| OLD | NEW | 
|---|