Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: components/omnibox/browser/autocomplete_controller.cc

Issue 2266083002: Avoid DCHECK failure for chrome:// URLs in autocomplete suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes for pkasting@ Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 if (provider_types & AutocompleteProvider::TYPE_CLIPBOARD_URL) { 215 if (provider_types & AutocompleteProvider::TYPE_CLIPBOARD_URL) {
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 = PhysicalWebProvider::Create(
226 PhysicalWebProvider::Create(provider_client_.get()); 226 provider_client_.get(), history_url_provider_);
227 if (physical_web_provider) 227 if (physical_web_provider)
228 providers_.push_back(physical_web_provider); 228 providers_.push_back(physical_web_provider);
229 } 229 }
230 } 230 }
231 231
232 AutocompleteController::~AutocompleteController() { 232 AutocompleteController::~AutocompleteController() {
233 // The providers may have tasks outstanding that hold refs to them. We need 233 // 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, 234 // 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 235 // 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 236 // 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
666 expire_timer_.Stop(); 666 expire_timer_.Stop();
667 stop_timer_.Stop(); 667 stop_timer_.Stop();
668 done_ = true; 668 done_ = true;
669 if (clear_result && !result_.empty()) { 669 if (clear_result && !result_.empty()) {
670 result_.Reset(); 670 result_.Reset();
671 // NOTE: We pass in false since we're trying to only clear the popup, not 671 // 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 :( 672 // touch the edit... this is all a mess and should be cleaned up :(
673 NotifyChanged(false); 673 NotifyChanged(false);
674 } 674 }
675 } 675 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc ('k') | components/omnibox/browser/autocomplete_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698