| 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 "chrome/browser/autocomplete/shortcuts_provider.h" | 5 #include "chrome/browser/autocomplete/shortcuts_provider.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/i18n/break_iterator.h" | 12 #include "base/i18n/break_iterator.h" |
| 13 #include "base/i18n/case_conversion.h" | 13 #include "base/i18n/case_conversion.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "base/time.h" | 18 #include "base/time.h" |
| 19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 20 #include "chrome/browser/autocomplete/autocomplete.h" | 20 #include "chrome/browser/autocomplete/autocomplete.h" |
| 21 #include "chrome/browser/autocomplete/autocomplete_provider_listener.h" | 21 #include "chrome/browser/autocomplete/autocomplete_provider_listener.h" |
| 22 #include "chrome/browser/autocomplete/autocomplete_result.h" |
| 22 #include "chrome/browser/history/history.h" | 23 #include "chrome/browser/history/history.h" |
| 23 #include "chrome/browser/history/history_notifications.h" | 24 #include "chrome/browser/history/history_notifications.h" |
| 24 #include "chrome/browser/history/history_service_factory.h" | 25 #include "chrome/browser/history/history_service_factory.h" |
| 25 #include "chrome/browser/prefs/pref_service.h" | 26 #include "chrome/browser/prefs/pref_service.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 29 #include "googleurl/src/url_parse.h" | 30 #include "googleurl/src/url_parse.h" |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } | 305 } |
| 305 | 306 |
| 306 void ShortcutsProvider::set_shortcuts_backend( | 307 void ShortcutsProvider::set_shortcuts_backend( |
| 307 history::ShortcutsBackend* shortcuts_backend) { | 308 history::ShortcutsBackend* shortcuts_backend) { |
| 308 DCHECK(shortcuts_backend); | 309 DCHECK(shortcuts_backend); |
| 309 shortcuts_backend_ = shortcuts_backend; | 310 shortcuts_backend_ = shortcuts_backend; |
| 310 shortcuts_backend_->AddObserver(this); | 311 shortcuts_backend_->AddObserver(this); |
| 311 if (shortcuts_backend_->initialized()) | 312 if (shortcuts_backend_->initialized()) |
| 312 initialized_ = true; | 313 initialized_ = true; |
| 313 } | 314 } |
| OLD | NEW |