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 #ifndef COMPONENTS_OMNIBOX_BROWSER_SHORTCUTS_DATABASE_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_SHORTCUTS_DATABASE_H_ |
6 #define COMPONENTS_OMNIBOX_BROWSER_SHORTCUTS_DATABASE_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_SHORTCUTS_DATABASE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 struct MatchCore { | 44 struct MatchCore { |
45 MatchCore(const base::string16& fill_into_edit, | 45 MatchCore(const base::string16& fill_into_edit, |
46 const GURL& destination_url, | 46 const GURL& destination_url, |
47 const base::string16& contents, | 47 const base::string16& contents, |
48 const std::string& contents_class, | 48 const std::string& contents_class, |
49 const base::string16& description, | 49 const base::string16& description, |
50 const std::string& description_class, | 50 const std::string& description_class, |
51 int transition, | 51 int transition, |
52 int type, | 52 int type, |
53 const base::string16& keyword); | 53 const base::string16& keyword); |
| 54 MatchCore(const MatchCore& other); |
54 ~MatchCore(); | 55 ~MatchCore(); |
55 | 56 |
56 base::string16 fill_into_edit; | 57 base::string16 fill_into_edit; |
57 GURL destination_url; | 58 GURL destination_url; |
58 base::string16 contents; | 59 base::string16 contents; |
59 // For both contents_class and description_class, we strip MATCH | 60 // For both contents_class and description_class, we strip MATCH |
60 // classifications; the ShortcutsProvider will re-mark MATCH regions based | 61 // classifications; the ShortcutsProvider will re-mark MATCH regions based |
61 // on the user's current typing. | 62 // on the user's current typing. |
62 std::string contents_class; | 63 std::string contents_class; |
63 base::string16 description; | 64 base::string16 description; |
64 std::string description_class; | 65 std::string description_class; |
65 int transition; | 66 int transition; |
66 int type; | 67 int type; |
67 base::string16 keyword; | 68 base::string16 keyword; |
68 }; | 69 }; |
69 | 70 |
70 Shortcut(const std::string& id, | 71 Shortcut(const std::string& id, |
71 const base::string16& text, | 72 const base::string16& text, |
72 const MatchCore& match_core, | 73 const MatchCore& match_core, |
73 const base::Time& last_access_time, | 74 const base::Time& last_access_time, |
74 int number_of_hits); | 75 int number_of_hits); |
75 // Required for STL, we don't use this directly. | 76 // Required for STL, we don't use this directly. |
76 Shortcut(); | 77 Shortcut(); |
| 78 Shortcut(const Shortcut& other); |
77 ~Shortcut(); | 79 ~Shortcut(); |
78 | 80 |
79 std::string id; // Unique guid for the shortcut. | 81 std::string id; // Unique guid for the shortcut. |
80 base::string16 text; // The user's original input string. | 82 base::string16 text; // The user's original input string. |
81 MatchCore match_core; | 83 MatchCore match_core; |
82 base::Time last_access_time; // Last time shortcut was selected. | 84 base::Time last_access_time; // Last time shortcut was selected. |
83 int number_of_hits; // How many times shortcut was selected. | 85 int number_of_hits; // How many times shortcut was selected. |
84 }; | 86 }; |
85 | 87 |
86 typedef std::vector<std::string> ShortcutIDs; | 88 typedef std::vector<std::string> ShortcutIDs; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // The sql database. Not valid until Init is called. | 127 // The sql database. Not valid until Init is called. |
126 sql::Connection db_; | 128 sql::Connection db_; |
127 base::FilePath database_path_; | 129 base::FilePath database_path_; |
128 | 130 |
129 sql::MetaTable meta_table_; | 131 sql::MetaTable meta_table_; |
130 | 132 |
131 DISALLOW_COPY_AND_ASSIGN(ShortcutsDatabase); | 133 DISALLOW_COPY_AND_ASSIGN(ShortcutsDatabase); |
132 }; | 134 }; |
133 | 135 |
134 #endif // COMPONENTS_OMNIBOX_BROWSER_SHORTCUTS_DATABASE_H_ | 136 #endif // COMPONENTS_OMNIBOX_BROWSER_SHORTCUTS_DATABASE_H_ |
OLD | NEW |