Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / history / history_notifications.h
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
3 // found in the LICENSE file.
4
5 // Structs that hold data used in broadcasting notifications.
6
7 #ifndef CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__
8 #define CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__
9
10 #include <set>
11
12 #include "chrome/browser/history/history_details.h"
13 #include "components/history/core/browser/history_types.h"
14 #include "components/history/core/browser/keyword_id.h"
15 #include "url/gurl.h"
16
17 namespace history {
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.
53 struct KeywordSearchUpdatedDetails : public HistoryDetails {
54   KeywordSearchUpdatedDetails(const URLRow& url_row,
55                               KeywordID keyword_id,
56                               const base::string16& term);
57   ~KeywordSearchUpdatedDetails() override;
58
59   // The affected URLRow. The ID will be set to the value that is currently in
60   // effect in the main history database.
61   URLRow url_row;
62   KeywordID keyword_id;
63   base::string16 term;
64 };
65
66 // Details for HISTORY_KEYWORD_SEARCH_TERM_DELETED.
67 struct KeywordSearchDeletedDetails : public HistoryDetails {
68   explicit KeywordSearchDeletedDetails(URLID url_row_id);
69   ~KeywordSearchDeletedDetails() override;
70
71   // The ID of the corresponding URLRow in the main history database.
72   URLID url_row_id;
73 };
74
75 }  // namespace history
76
77 #endif  // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__