Home | History | Annotate | Download | only in history
      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 "chrome/browser/history/history_types.h"
     14 #include "chrome/browser/search_engines/template_url_id.h"
     15 #include "url/gurl.h"
     16 
     17 namespace history {
     18 
     19 // Details for NOTIFICATION_HISTORY_URL_VISITED.
     20 struct URLVisitedDetails : public HistoryDetails {
     21   URLVisitedDetails();
     22   virtual ~URLVisitedDetails();
     23 
     24   content::PageTransition transition;
     25   URLRow row;
     26 
     27   // A list of redirects leading up to the URL represented by this struct. If
     28   // we have the redirect chain A -> B -> C and this struct represents visiting
     29   // C, then redirects[0]=B and redirects[1]=A.  If there are no redirects,
     30   // this will be an empty vector.
     31   history::RedirectList redirects;
     32 };
     33 
     34 // Details for NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED.
     35 struct URLsModifiedDetails : public HistoryDetails {
     36   URLsModifiedDetails();
     37   virtual ~URLsModifiedDetails();
     38 
     39   // Lists the information for each of the URLs affected.
     40   URLRows changed_urls;
     41 };
     42 
     43 // Details for NOTIFICATION_HISTORY_URLS_DELETED.
     44 struct URLsDeletedDetails : public HistoryDetails {
     45   URLsDeletedDetails();
     46   virtual ~URLsDeletedDetails();
     47 
     48   // Set when all history was deleted. False means just a subset was deleted.
     49   bool all_history;
     50 
     51   // True if the data was archived. False if the data was deleted in response to
     52   // an explicit user action through the History UI.
     53   bool archived;
     54 
     55   // The URLRows of URLs deleted. This is valid only when |all_history| is false
     56   // indicating that a subset of history has been deleted.
     57   URLRows rows;
     58 
     59   // The list of deleted favicon urls. This is valid only when |all_history| is
     60   // false, indicating that a subset of history has been deleted.
     61   std::set<GURL> favicon_urls;
     62 };
     63 
     64 // Details for HISTORY_KEYWORD_SEARCH_TERM_UPDATED.
     65 struct KeywordSearchTermDetails : public HistoryDetails {
     66   KeywordSearchTermDetails();
     67   virtual ~KeywordSearchTermDetails();
     68 
     69   GURL url;
     70   TemplateURLID keyword_id;
     71   string16 term;
     72 };
     73 
     74 }  // namespace history
     75 
     76 #endif  // CHROME_BROWSER_HISTORY_HISTORY_NOTIFICATIONS_H__
     77