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 <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <functional> | 10 #include <functional> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
18 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "chrome/browser/autocomplete/autocomplete_result.h" | 20 #include "chrome/browser/autocomplete/autocomplete_result.h" |
21 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" | 21 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
22 #include "chrome/browser/autocomplete/shortcuts_backend.h" | 22 #include "chrome/browser/autocomplete/shortcuts_backend.h" |
23 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" | 23 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" |
24 #include "chrome/browser/chrome_notification_types.h" | |
25 #include "chrome/browser/history/history_service.h" | 24 #include "chrome/browser/history/history_service.h" |
26 #include "chrome/browser/history/in_memory_url_index.h" | 25 #include "chrome/browser/history/in_memory_url_index.h" |
27 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
28 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
29 #include "components/autocomplete/autocomplete_input.h" | 28 #include "components/autocomplete/autocomplete_input.h" |
30 #include "components/autocomplete/autocomplete_match.h" | 29 #include "components/autocomplete/autocomplete_match.h" |
31 #include "components/autocomplete/autocomplete_provider.h" | 30 #include "components/autocomplete/autocomplete_provider.h" |
32 #include "components/history/core/browser/url_database.h" | 31 #include "components/history/core/browser/url_database.h" |
33 #include "components/metrics/proto/omnibox_event.pb.h" | 32 #include "components/metrics/proto/omnibox_event.pb.h" |
34 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
35 #include "content/public/test/test_browser_thread.h" | 34 #include "content/public/test/test_browser_thread.h" |
| 35 #include "extensions/browser/notification_types.h" |
36 #include "extensions/common/extension.h" | 36 #include "extensions/common/extension.h" |
37 #include "extensions/common/extension_builder.h" | 37 #include "extensions/common/extension_builder.h" |
38 #include "extensions/common/value_builder.h" | 38 #include "extensions/common/value_builder.h" |
39 #include "testing/gtest/include/gtest/gtest.h" | 39 #include "testing/gtest/include/gtest/gtest.h" |
40 | 40 |
41 using base::ASCIIToUTF16; | 41 using base::ASCIIToUTF16; |
42 | 42 |
43 // TestShortcutInfo ----------------------------------------------------------- | 43 // TestShortcutInfo ----------------------------------------------------------- |
44 | 44 |
45 namespace { | 45 namespace { |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 scoped_refptr<const extensions::Extension> extension = | 833 scoped_refptr<const extensions::Extension> extension = |
834 extensions::ExtensionBuilder() | 834 extensions::ExtensionBuilder() |
835 .SetManifest(extensions::DictionaryBuilder() | 835 .SetManifest(extensions::DictionaryBuilder() |
836 .Set("name", "Echo") | 836 .Set("name", "Echo") |
837 .Set("version", "1.0")) | 837 .Set("version", "1.0")) |
838 .SetID("cedabbhfglmiikkmdgcpjdkocfcmbkee") | 838 .SetID("cedabbhfglmiikkmdgcpjdkocfcmbkee") |
839 .Build(); | 839 .Build(); |
840 extensions::UnloadedExtensionInfo details( | 840 extensions::UnloadedExtensionInfo details( |
841 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); | 841 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); |
842 content::NotificationService::current()->Notify( | 842 content::NotificationService::current()->Notify( |
843 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, | 843 extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
844 content::Source<Profile>(&profile_), | 844 content::Source<Profile>(&profile_), |
845 content::Details<extensions::UnloadedExtensionInfo>(&details)); | 845 content::Details<extensions::UnloadedExtensionInfo>(&details)); |
846 | 846 |
847 // Now the URL should have disappeared. | 847 // Now the URL should have disappeared. |
848 RunTest(text, false, ExpectedURLs(), std::string(), base::string16()); | 848 RunTest(text, false, ExpectedURLs(), std::string(), base::string16()); |
849 } | 849 } |
OLD | NEW |