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 "chrome/browser/history/history_types.h"
14 #include "chrome/browser/search_engines/template_url_id.h"
19 // Details for NOTIFICATION_HISTORY_URL_VISITED.
20 struct URLVisitedDetails : public HistoryDetails {
22 virtual ~URLVisitedDetails();
24 content::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;
37 // Details for NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED.
38 struct URLsModifiedDetails : public HistoryDetails {
39 URLsModifiedDetails();
40 virtual ~URLsModifiedDetails();
42 // Lists the information for each of the URLs affected. The rows will have the
43 // IDs that are currently in effect in the main history database.
47 // Details for NOTIFICATION_HISTORY_URLS_DELETED.
48 struct URLsDeletedDetails : public HistoryDetails {
50 virtual ~URLsDeletedDetails();
52 // Set when all history was deleted. False means just a subset was deleted.
55 // True if the data was archived. False if the data was deleted in response to
56 // an explicit user action through the History UI.
59 // The URLRows of URLs deleted. This is valid only when |all_history| is false
60 // indicating that a subset of history has been deleted. The rows will have
61 // the IDs that had been in effect before the deletion in the main history
65 // The list of deleted favicon urls. This is valid only when |all_history| is
66 // false, indicating that a subset of history has been deleted.
67 std::set<GURL> favicon_urls;
70 // Details for HISTORY_KEYWORD_SEARCH_TERM_UPDATED.
71 struct KeywordSearchUpdatedDetails : public HistoryDetails {
72 KeywordSearchUpdatedDetails(const URLRow& url_row,
73 TemplateURLID keyword_id,
74 const base::string16& term);
75 virtual ~KeywordSearchUpdatedDetails();
77 // The affected URLRow. The ID will be set to the value that is currently in
78 // effect in the main history database.
80 TemplateURLID keyword_id;
84 // Details for HISTORY_KEYWORD_SEARCH_TERM_DELETED.
85 struct KeywordSearchDeletedDetails : public HistoryDetails {
86 explicit KeywordSearchDeletedDetails(URLID url_row_id);
87 virtual ~KeywordSearchDeletedDetails();
89 // The ID of the corresponding URLRow in the main history database.
93 } // namespace history
95 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__