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.
5 // Structs that hold data used in broadcasting notifications.
7 #ifndef CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__
8 #define CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__
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"
19 // Details for NOTIFICATION_HISTORY_URL_VISITED.
20 struct URLVisitedDetails : public HistoryDetails {
22 virtual ~URLVisitedDetails();
24 ui::PageTransition transition;
26 // The affected URLRow. The ID will be set to the value that is currently in
27 // effect in the main history database.
30 // A list of redirects leading up to the URL represented by this struct. If
31 // we have the redirect chain A -> B -> C and this struct represents visiting
32 // C, then redirects[0]=B and redirects[1]=A. If there are no redirects,
33 // this will be an empty vector.
34 history::RedirectList redirects;
36 base::Time visit_time;
39 // Details for NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED.
40 struct URLsModifiedDetails : public HistoryDetails {
41 URLsModifiedDetails();
42 virtual ~URLsModifiedDetails();
44 // Lists the information for each of the URLs affected. The rows will have the
45 // IDs that are currently in effect in the main history database.
49 // Details for NOTIFICATION_HISTORY_URLS_DELETED.
50 struct URLsDeletedDetails : public HistoryDetails {
52 virtual ~URLsDeletedDetails();
54 // Set when all history was deleted. False means just a subset was deleted.
57 // True if the data was expired due to old age. False if the data was deleted
58 // in response to an explicit user action through the History UI.
61 // The URLRows of URLs deleted. This is valid only when |all_history| is false
62 // indicating that a subset of history has been deleted. The rows will have
63 // the IDs that had been in effect before the deletion in the main history
67 // The list of deleted favicon urls. This is valid only when |all_history| is
68 // false, indicating that a subset of history has been deleted.
69 std::set<GURL> favicon_urls;
72 // Details for HISTORY_KEYWORD_SEARCH_TERM_UPDATED.
73 struct KeywordSearchUpdatedDetails : public HistoryDetails {
74 KeywordSearchUpdatedDetails(const URLRow& url_row,
76 const base::string16& term);
77 virtual ~KeywordSearchUpdatedDetails();
79 // The affected URLRow. The ID will be set to the value that is currently in
80 // effect in the main history database.
86 // Details for HISTORY_KEYWORD_SEARCH_TERM_DELETED.
87 struct KeywordSearchDeletedDetails : public HistoryDetails {
88 explicit KeywordSearchDeletedDetails(URLID url_row_id);
89 virtual ~KeywordSearchDeletedDetails();
91 // The ID of the corresponding URLRow in the main history database.
95 } // namespace history
97 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__