| OLD | NEW |
| 1 // Copyright (c) 2006-2008 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 HISTORY_URL_VISITED. | 28 // Details for NOTIFICATION_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 NOTIFY_HISTORY_TYPED_URLS_MODIFIED. | 43 // Details for NOTIFICATION_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 NOTIFY_HISTORY_URLS_DELETED. | 52 // Details for NOTIFICATION_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 |
| 60 // The list of unique URLs affected. This is valid only when a subset of | 63 // The list of unique URLs affected. This is valid only when a subset of |
| 61 // history is deleted. When all of it is deleted, this will be empty, since | 64 // history is deleted. When all of it is deleted, this will be empty, since |
| 62 // we do not bother to list all URLs. | 65 // we do not bother to list all URLs. (This information can be gleaned from |
| 66 // |rows| but, since there are several clients who need the set, we pre-build |
| 67 // it so that the clients don't have to.) |
| 63 std::set<GURL> urls; | 68 std::set<GURL> urls; |
| 64 }; | 69 }; |
| 65 | 70 |
| 66 // Details for NOTIFY_URLS_STARRED. | 71 // Details for NOTIFY_URLS_STARRED. |
| 67 struct URLsStarredDetails : public HistoryDetails { | 72 struct URLsStarredDetails : public HistoryDetails { |
| 68 explicit URLsStarredDetails(bool being_starred); | 73 explicit URLsStarredDetails(bool being_starred); |
| 69 virtual ~URLsStarredDetails(); | 74 virtual ~URLsStarredDetails(); |
| 70 | 75 |
| 71 // The new starred state of the list of URLs. True when they are being | 76 // The new starred state of the list of URLs. True when they are being |
| 72 // starred, false when they are being unstarred. | 77 // starred, false when they are being unstarred. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 90 virtual ~KeywordSearchTermDetails(); | 95 virtual ~KeywordSearchTermDetails(); |
| 91 | 96 |
| 92 GURL url; | 97 GURL url; |
| 93 TemplateURLID keyword_id; | 98 TemplateURLID keyword_id; |
| 94 string16 term; | 99 string16 term; |
| 95 }; | 100 }; |
| 96 | 101 |
| 97 } // namespace history | 102 } // namespace history |
| 98 | 103 |
| 99 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ | 104 #endif // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__ |
| OLD | NEW |