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

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

Issue 1815653002: Revert of Add traces for main omnibox providers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/bookmark_provider.h" 5 #include "components/omnibox/browser/bookmark_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "base/trace_event/trace_event.h"
15 #include "components/bookmarks/browser/bookmark_match.h" 14 #include "components/bookmarks/browser/bookmark_match.h"
16 #include "components/bookmarks/browser/bookmark_model.h" 15 #include "components/bookmarks/browser/bookmark_model.h"
17 #include "components/metrics/proto/omnibox_input_type.pb.h" 16 #include "components/metrics/proto/omnibox_input_type.pb.h"
18 #include "components/omnibox/browser/autocomplete_provider_client.h" 17 #include "components/omnibox/browser/autocomplete_provider_client.h"
19 #include "components/omnibox/browser/autocomplete_result.h" 18 #include "components/omnibox/browser/autocomplete_result.h"
20 #include "components/omnibox/browser/history_provider.h" 19 #include "components/omnibox/browser/history_provider.h"
21 #include "components/omnibox/browser/url_prefix.h" 20 #include "components/omnibox/browser/url_prefix.h"
22 #include "components/prefs/pref_service.h" 21 #include "components/prefs/pref_service.h"
23 #include "components/url_formatter/url_formatter.h" 22 #include "components/url_formatter/url_formatter.h"
24 #include "url/url_constants.h" 23 #include "url/url_constants.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 client_(client), 58 client_(client),
60 bookmark_model_(NULL) { 59 bookmark_model_(NULL) {
61 if (client_) { 60 if (client_) {
62 bookmark_model_ = client_->GetBookmarkModel(); 61 bookmark_model_ = client_->GetBookmarkModel();
63 languages_ = client_->GetAcceptLanguages(); 62 languages_ = client_->GetAcceptLanguages();
64 } 63 }
65 } 64 }
66 65
67 void BookmarkProvider::Start(const AutocompleteInput& input, 66 void BookmarkProvider::Start(const AutocompleteInput& input,
68 bool minimal_changes) { 67 bool minimal_changes) {
69 TRACE_EVENT0("omnibox", "BookmarkProvider::Start");
70 if (minimal_changes) 68 if (minimal_changes)
71 return; 69 return;
72 matches_.clear(); 70 matches_.clear();
73 71
74 if (input.from_omnibox_focus() || input.text().empty() || 72 if (input.from_omnibox_focus() || input.text().empty() ||
75 (input.type() == metrics::OmniboxInputType::FORCED_QUERY)) 73 (input.type() == metrics::OmniboxInputType::FORCED_QUERY))
76 return; 74 return;
77 75
78 DoAutocomplete(input); 76 DoAutocomplete(input);
79 } 77 }
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 i != positions.end(); 337 i != positions.end();
340 ++i) { 338 ++i) {
341 AutocompleteMatch::ACMatchClassifications new_class; 339 AutocompleteMatch::ACMatchClassifications new_class;
342 AutocompleteMatch::ClassifyLocationInString(i->first, i->second - i->first, 340 AutocompleteMatch::ClassifyLocationInString(i->first, i->second - i->first,
343 text_length, url_style, &new_class); 341 text_length, url_style, &new_class);
344 classifications = AutocompleteMatch::MergeClassifications( 342 classifications = AutocompleteMatch::MergeClassifications(
345 classifications, new_class); 343 classifications, new_class);
346 } 344 }
347 return classifications; 345 return classifications;
348 } 346 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/autocomplete_controller.cc ('k') | components/omnibox/browser/history_quick_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698