Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: chrome/browser/history/history_notifications.h

Issue 8437035: Revert 108207 - HQP Refactoring (in Preparation for SQLite Cache) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #pragma once 9 #pragma once
10 10
11 #include <set> 11 #include <set>
12 #include <vector> 12 #include <vector>
13 13
14 #include "googleurl/src/gurl.h" 14 #include "googleurl/src/gurl.h"
15 #include "chrome/browser/history/history_types.h" 15 #include "chrome/browser/history/history_types.h"
16 #include "chrome/browser/search_engines/template_url_id.h" 16 #include "chrome/browser/search_engines/template_url_id.h"
17 17
18 namespace history { 18 namespace history {
19 19
20 // Base class for history notifications. This needs only a virtual destructor 20 // Base class for history notifications. This needs only a virtual destructor
21 // so that the history service's broadcaster can delete it when the request 21 // so that the history service's broadcaster can delete it when the request
22 // is complete. 22 // is complete.
23 struct HistoryDetails { 23 struct HistoryDetails {
24 public: 24 public:
25 virtual ~HistoryDetails() {} 25 virtual ~HistoryDetails() {}
26 }; 26 };
27 27
28 // Details for NOTIFICATION_HISTORY_URL_VISITED. 28 // Details for HISTORY_URL_VISITED.
29 struct URLVisitedDetails : public HistoryDetails { 29 struct URLVisitedDetails : public HistoryDetails {
30 URLVisitedDetails(); 30 URLVisitedDetails();
31 virtual ~URLVisitedDetails(); 31 virtual ~URLVisitedDetails();
32 32
33 content::PageTransition transition; 33 content::PageTransition transition;
34 URLRow row; 34 URLRow row;
35 35
36 // A list of redirects leading up to the URL represented by this struct. If 36 // A list of redirects leading up to the URL represented by this struct. If
37 // we have the redirect chain A -> B -> C and this struct represents visiting 37 // we have the redirect chain A -> B -> C and this struct represents visiting
38 // C, then redirects[0]=B and redirects[1]=A. If there are no redirects, 38 // C, then redirects[0]=B and redirects[1]=A. If there are no redirects,
39 // this will be an empty vector. 39 // this will be an empty vector.
40 history::RedirectList redirects; 40 history::RedirectList redirects;
41 }; 41 };
42 42
43 // Details for NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED. 43 // Details for NOTIFY_HISTORY_TYPED_URLS_MODIFIED.
44 struct URLsModifiedDetails : public HistoryDetails { 44 struct URLsModifiedDetails : public HistoryDetails {
45 URLsModifiedDetails(); 45 URLsModifiedDetails();
46 virtual ~URLsModifiedDetails(); 46 virtual ~URLsModifiedDetails();
47 47
48 // Lists the information for each of the URLs affected. 48 // Lists the information for each of the URLs affected.
49 std::vector<URLRow> changed_urls; 49 std::vector<URLRow> changed_urls;
50 }; 50 };
51 51
52 // Details for NOTIFICATION_HISTORY_URLS_DELETED. 52 // Details for NOTIFY_HISTORY_URLS_DELETED.
53 struct URLsDeletedDetails : public HistoryDetails { 53 struct URLsDeletedDetails : public HistoryDetails {
54 URLsDeletedDetails(); 54 URLsDeletedDetails();
55 virtual ~URLsDeletedDetails(); 55 virtual ~URLsDeletedDetails();
56 56
57 // Set when all history was deleted. False means just a subset was deleted. 57 // Set when all history was deleted. False means just a subset was deleted.
58 bool all_history; 58 bool all_history;
59 59
60 // The URLRows which have been deleted.
61 std::vector<URLRow> rows;
62
63 // The list of unique URLs affected. This is valid only when a subset of 60 // The list of unique URLs affected. This is valid only when a subset of
64 // history is deleted. When all of it is deleted, this will be empty, since 61 // history is deleted. When all of it is deleted, this will be empty, since
65 // we do not bother to list all URLs. (This information can be gleaned from 62 // we do not bother to list all URLs.
66 // |rows| but, since there are several clients that need the set, we
67 // pre-build it so that the clients don't have to.)
68 std::set<GURL> urls; 63 std::set<GURL> urls;
69 }; 64 };
70 65
71 // Details for NOTIFY_URLS_STARRED. 66 // Details for NOTIFY_URLS_STARRED.
72 struct URLsStarredDetails : public HistoryDetails { 67 struct URLsStarredDetails : public HistoryDetails {
73 explicit URLsStarredDetails(bool being_starred); 68 explicit URLsStarredDetails(bool being_starred);
74 virtual ~URLsStarredDetails(); 69 virtual ~URLsStarredDetails();
75 70
76 // The new starred state of the list of URLs. True when they are being 71 // The new starred state of the list of URLs. True when they are being
77 // starred, false when they are being unstarred. 72 // starred, false when they are being unstarred.
(...skipping 17 matching lines...) Expand all
95 virtual ~KeywordSearchTermDetails(); 90 virtual ~KeywordSearchTermDetails();
96 91
97 GURL url; 92 GURL url;
98 TemplateURLID keyword_id; 93 TemplateURLID keyword_id;
99 string16 term; 94 string16 term;
100 }; 95 };
101 96
102 } // namespace history 97 } // namespace history
103 98
104 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ 99 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__
OLDNEW
« no previous file with comments | « chrome/browser/history/history_backend_unittest.cc ('k') | chrome/browser/history/history_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698