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 // Structs that hold data used in broadcasting notifications. | 5 // Structs that hold data used in broadcasting notifications. |
6 | 6 |
7 #ifndef CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ | 7 #ifndef CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ |
8 #define CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ | 8 #define CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ |
9 | 9 |
10 #include <set> | 10 #include <set> |
11 | 11 |
12 #include "chrome/browser/history/history_details.h" | 12 #include "chrome/browser/history/history_details.h" |
13 #include "components/history/core/browser/history_types.h" | 13 #include "components/history/core/browser/history_types.h" |
14 #include "components/history/core/browser/keyword_id.h" | 14 #include "components/history/core/browser/keyword_id.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
17 namespace history { | 17 namespace history { |
18 | 18 |
19 // Details for NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED. | 19 // Details for NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED. |
20 struct URLsModifiedDetails : public HistoryDetails { | 20 struct URLsModifiedDetails : public HistoryDetails { |
21 URLsModifiedDetails(); | 21 URLsModifiedDetails(); |
22 virtual ~URLsModifiedDetails(); | 22 ~URLsModifiedDetails() override; |
23 | 23 |
24 // Lists the information for each of the URLs affected. The rows will have the | 24 // Lists the information for each of the URLs affected. The rows will have the |
25 // IDs that are currently in effect in the main history database. | 25 // IDs that are currently in effect in the main history database. |
26 URLRows changed_urls; | 26 URLRows changed_urls; |
27 }; | 27 }; |
28 | 28 |
29 // Details for NOTIFICATION_HISTORY_URLS_DELETED. | 29 // Details for NOTIFICATION_HISTORY_URLS_DELETED. |
30 struct URLsDeletedDetails : public HistoryDetails { | 30 struct URLsDeletedDetails : public HistoryDetails { |
31 URLsDeletedDetails(); | 31 URLsDeletedDetails(); |
32 virtual ~URLsDeletedDetails(); | 32 ~URLsDeletedDetails() override; |
33 | 33 |
34 // Set when all history was deleted. False means just a subset was deleted. | 34 // Set when all history was deleted. False means just a subset was deleted. |
35 bool all_history; | 35 bool all_history; |
36 | 36 |
37 // True if the data was expired due to old age. False if the data was deleted | 37 // True if the data was expired due to old age. False if the data was deleted |
38 // in response to an explicit user action through the History UI. | 38 // in response to an explicit user action through the History UI. |
39 bool expired; | 39 bool expired; |
40 | 40 |
41 // The URLRows of URLs deleted. This is valid only when |all_history| is false | 41 // The URLRows of URLs deleted. This is valid only when |all_history| is false |
42 // indicating that a subset of history has been deleted. The rows will have | 42 // indicating that a subset of history has been deleted. The rows will have |
43 // the IDs that had been in effect before the deletion in the main history | 43 // the IDs that had been in effect before the deletion in the main history |
44 // database. | 44 // database. |
45 URLRows rows; | 45 URLRows rows; |
46 | 46 |
47 // The list of deleted favicon urls. This is valid only when |all_history| is | 47 // The list of deleted favicon urls. This is valid only when |all_history| is |
48 // false, indicating that a subset of history has been deleted. | 48 // false, indicating that a subset of history has been deleted. |
49 std::set<GURL> favicon_urls; | 49 std::set<GURL> favicon_urls; |
50 }; | 50 }; |
51 | 51 |
52 // Details for HISTORY_KEYWORD_SEARCH_TERM_UPDATED. | 52 // Details for HISTORY_KEYWORD_SEARCH_TERM_UPDATED. |
53 struct KeywordSearchUpdatedDetails : public HistoryDetails { | 53 struct KeywordSearchUpdatedDetails : public HistoryDetails { |
54 KeywordSearchUpdatedDetails(const URLRow& url_row, | 54 KeywordSearchUpdatedDetails(const URLRow& url_row, |
55 KeywordID keyword_id, | 55 KeywordID keyword_id, |
56 const base::string16& term); | 56 const base::string16& term); |
57 virtual ~KeywordSearchUpdatedDetails(); | 57 ~KeywordSearchUpdatedDetails() override; |
58 | 58 |
59 // The affected URLRow. The ID will be set to the value that is currently in | 59 // The affected URLRow. The ID will be set to the value that is currently in |
60 // effect in the main history database. | 60 // effect in the main history database. |
61 URLRow url_row; | 61 URLRow url_row; |
62 KeywordID keyword_id; | 62 KeywordID keyword_id; |
63 base::string16 term; | 63 base::string16 term; |
64 }; | 64 }; |
65 | 65 |
66 // Details for HISTORY_KEYWORD_SEARCH_TERM_DELETED. | 66 // Details for HISTORY_KEYWORD_SEARCH_TERM_DELETED. |
67 struct KeywordSearchDeletedDetails : public HistoryDetails { | 67 struct KeywordSearchDeletedDetails : public HistoryDetails { |
68 explicit KeywordSearchDeletedDetails(URLID url_row_id); | 68 explicit KeywordSearchDeletedDetails(URLID url_row_id); |
69 virtual ~KeywordSearchDeletedDetails(); | 69 ~KeywordSearchDeletedDetails() override; |
70 | 70 |
71 // The ID of the corresponding URLRow in the main history database. | 71 // The ID of the corresponding URLRow in the main history database. |
72 URLID url_row_id; | 72 URLID url_row_id; |
73 }; | 73 }; |
74 | 74 |
75 } // namespace history | 75 } // namespace history |
76 | 76 |
77 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ | 77 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ |
OLD | NEW |