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_backend.h" | 5 #include "chrome/browser/autocomplete/shortcuts_backend.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/guid.h" | 13 #include "base/guid.h" |
14 #include "base/i18n/case_conversion.h" | 14 #include "base/i18n/case_conversion.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "chrome/browser/autocomplete/autocomplete_match.h" | 16 #include "chrome/browser/autocomplete/autocomplete_match.h" |
17 #include "chrome/browser/autocomplete/autocomplete_result.h" | 17 #include "chrome/browser/autocomplete/autocomplete_result.h" |
18 #include "chrome/browser/autocomplete/base_search_provider.h" | 18 #include "chrome/browser/autocomplete/base_search_provider.h" |
19 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
20 #include "chrome/browser/history/history_notifications.h" | 20 #include "chrome/browser/history/history_notifications.h" |
21 #include "chrome/browser/history/history_service.h" | 21 #include "chrome/browser/history/history_service.h" |
22 #include "chrome/browser/history/shortcuts_database.h" | 22 #include "chrome/browser/history/shortcuts_database.h" |
23 #include "chrome/browser/omnibox/omnibox_log.h" | 23 #include "chrome/browser/omnibox/omnibox_log.h" |
24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/search_engines/template_url_service_factory.h" | 25 #include "chrome/browser/search_engines/template_url_service_factory.h" |
26 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 26 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
27 #include "chrome/common/autocomplete_match_type.h" | |
28 #include "chrome/common/chrome_constants.h" | 27 #include "chrome/common/chrome_constants.h" |
29 #include "components/autocomplete/autocomplete_input.h" | 28 #include "components/autocomplete/autocomplete_input.h" |
| 29 #include "components/autocomplete/autocomplete_match_type.h" |
30 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" |
31 #include "content/public/browser/notification_details.h" | 31 #include "content/public/browser/notification_details.h" |
32 #include "content/public/browser/notification_source.h" | 32 #include "content/public/browser/notification_source.h" |
33 #include "extensions/common/extension.h" | 33 #include "extensions/common/extension.h" |
34 | 34 |
35 using content::BrowserThread; | 35 using content::BrowserThread; |
36 | 36 |
37 namespace { | 37 namespace { |
38 | 38 |
39 // Takes Match classification vector and removes all matched positions, | 39 // Takes Match classification vector and removes all matched positions, |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 guid_map_.clear(); | 319 guid_map_.clear(); |
320 FOR_EACH_OBSERVER(ShortcutsBackendObserver, observer_list_, | 320 FOR_EACH_OBSERVER(ShortcutsBackendObserver, observer_list_, |
321 OnShortcutsChanged()); | 321 OnShortcutsChanged()); |
322 return no_db_access_ || | 322 return no_db_access_ || |
323 BrowserThread::PostTask( | 323 BrowserThread::PostTask( |
324 BrowserThread::DB, FROM_HERE, | 324 BrowserThread::DB, FROM_HERE, |
325 base::Bind(base::IgnoreResult( | 325 base::Bind(base::IgnoreResult( |
326 &history::ShortcutsDatabase::DeleteAllShortcuts), | 326 &history::ShortcutsDatabase::DeleteAllShortcuts), |
327 db_.get())); | 327 db_.get())); |
328 } | 328 } |
OLD | NEW |