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. | |
20 struct URLsModifiedDetails : public HistoryDetails { | |
21 URLsModifiedDetails(); | |
22 ~URLsModifiedDetails() override; | |
23 | |
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. | |
26 URLRows changed_urls; | |
27 }; | |
28 | |
29 // Details for NOTIFICATION_HISTORY_URLS_DELETED. | |
30 struct URLsDeletedDetails : public HistoryDetails { | |
31 URLsDeletedDetails(); | |
32 ~URLsDeletedDetails() override; | |
33 | |
34 // Set when all history was deleted. False means just a subset was deleted. | |
35 bool all_history; | |
36 | |
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. | |
39 bool expired; | |
40 | |
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 | |
43 // the IDs that had been in effect before the deletion in the main history | |
44 // database. | |
45 URLRows rows; | |
46 | |
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. | |
49 std::set<GURL> favicon_urls; | |
50 }; | |
51 | |
52 // Details for HISTORY_KEYWORD_SEARCH_TERM_UPDATED. | 19 // Details for HISTORY_KEYWORD_SEARCH_TERM_UPDATED. |
53 struct KeywordSearchUpdatedDetails : public HistoryDetails { | 20 struct KeywordSearchUpdatedDetails : public HistoryDetails { |
54 KeywordSearchUpdatedDetails(const URLRow& url_row, | 21 KeywordSearchUpdatedDetails(const URLRow& url_row, |
55 KeywordID keyword_id, | 22 KeywordID keyword_id, |
56 const base::string16& term); | 23 const base::string16& term); |
57 ~KeywordSearchUpdatedDetails() override; | 24 ~KeywordSearchUpdatedDetails() override; |
58 | 25 |
59 // The affected URLRow. The ID will be set to the value that is currently in | 26 // The affected URLRow. The ID will be set to the value that is currently in |
60 // effect in the main history database. | 27 // effect in the main history database. |
61 URLRow url_row; | 28 URLRow url_row; |
62 KeywordID keyword_id; | 29 KeywordID keyword_id; |
63 base::string16 term; | 30 base::string16 term; |
64 }; | 31 }; |
65 | 32 |
66 // Details for HISTORY_KEYWORD_SEARCH_TERM_DELETED. | 33 // Details for HISTORY_KEYWORD_SEARCH_TERM_DELETED. |
67 struct KeywordSearchDeletedDetails : public HistoryDetails { | 34 struct KeywordSearchDeletedDetails : public HistoryDetails { |
68 explicit KeywordSearchDeletedDetails(URLID url_row_id); | 35 explicit KeywordSearchDeletedDetails(URLID url_row_id); |
69 ~KeywordSearchDeletedDetails() override; | 36 ~KeywordSearchDeletedDetails() override; |
70 | 37 |
71 // The ID of the corresponding URLRow in the main history database. | 38 // The ID of the corresponding URLRow in the main history database. |
72 URLID url_row_id; | 39 URLID url_row_id; |
73 }; | 40 }; |
74 | 41 |
75 } // namespace history | 42 } // namespace history |
76 | 43 |
77 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ | 44 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ |
OLD | NEW |