| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/omnibox/browser/autocomplete_controller.h" | 5 #include "components/omnibox/browser/autocomplete_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 ClipboardRecentContent* clipboard_recent_content = | 216 ClipboardRecentContent* clipboard_recent_content = |
| 217 ClipboardRecentContent::GetInstance(); | 217 ClipboardRecentContent::GetInstance(); |
| 218 if (clipboard_recent_content) { | 218 if (clipboard_recent_content) { |
| 219 providers_.push_back(new ClipboardURLProvider(provider_client_.get(), | 219 providers_.push_back(new ClipboardURLProvider(provider_client_.get(), |
| 220 history_url_provider_, | 220 history_url_provider_, |
| 221 clipboard_recent_content)); | 221 clipboard_recent_content)); |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 if (provider_types & AutocompleteProvider::TYPE_PHYSICAL_WEB) { | 224 if (provider_types & AutocompleteProvider::TYPE_PHYSICAL_WEB) { |
| 225 PhysicalWebProvider* physical_web_provider = | 225 PhysicalWebProvider* physical_web_provider = |
| 226 PhysicalWebProvider::Create(provider_client_.get()); | 226 PhysicalWebProvider::Create(provider_client_.get(), |
| 227 history_url_provider_); |
| 227 if (physical_web_provider) | 228 if (physical_web_provider) |
| 228 providers_.push_back(physical_web_provider); | 229 providers_.push_back(physical_web_provider); |
| 229 } | 230 } |
| 230 } | 231 } |
| 231 | 232 |
| 232 AutocompleteController::~AutocompleteController() { | 233 AutocompleteController::~AutocompleteController() { |
| 233 // The providers may have tasks outstanding that hold refs to them. We need | 234 // The providers may have tasks outstanding that hold refs to them. We need |
| 234 // to ensure they won't call us back if they outlive us. (Practically, | 235 // to ensure they won't call us back if they outlive us. (Practically, |
| 235 // calling Stop() should also cancel those tasks and make it so that we hold | 236 // calling Stop() should also cancel those tasks and make it so that we hold |
| 236 // the only refs.) We also don't want to bother notifying anyone of our | 237 // the only refs.) We also don't want to bother notifying anyone of our |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 expire_timer_.Stop(); | 667 expire_timer_.Stop(); |
| 667 stop_timer_.Stop(); | 668 stop_timer_.Stop(); |
| 668 done_ = true; | 669 done_ = true; |
| 669 if (clear_result && !result_.empty()) { | 670 if (clear_result && !result_.empty()) { |
| 670 result_.Reset(); | 671 result_.Reset(); |
| 671 // NOTE: We pass in false since we're trying to only clear the popup, not | 672 // NOTE: We pass in false since we're trying to only clear the popup, not |
| 672 // touch the edit... this is all a mess and should be cleaned up :( | 673 // touch the edit... this is all a mess and should be cleaned up :( |
| 673 NotifyChanged(false); | 674 NotifyChanged(false); |
| 674 } | 675 } |
| 675 } | 676 } |
| OLD | NEW |