Chromium Code Reviews| Index: components/history/core/browser/history_types.h |
| diff --git a/chrome/browser/history/history_types.h b/components/history/core/browser/history_types.h |
| similarity index 76% |
| copy from chrome/browser/history/history_types.h |
| copy to components/history/core/browser/history_types.h |
| index d2702ec5b16a4344f62a4a25026b85d1b53c1d2c..0392e97e91107244b98c4f3ac3175e4d78b55972 100644 |
| --- a/chrome/browser/history/history_types.h |
| +++ b/components/history/core/browser/history_types.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_HISTORY_HISTORY_TYPES_H_ |
| -#define CHROME_BROWSER_HISTORY_HISTORY_TYPES_H_ |
| +#ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_TYPES_H_ |
| +#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_TYPES_H_ |
| #include <deque> |
| #include <map> |
| @@ -20,17 +20,12 @@ |
| #include "components/favicon_base/favicon_types.h" |
| #include "components/history/core/browser/url_row.h" |
| #include "components/history/core/common/thumbnail_score.h" |
| -#include "content/public/common/page_transition_types.h" |
| #include "ui/gfx/image/image.h" |
|
msw
2014/08/04 16:56:31
You don't actually need this include afaict.
|
| #include "ui/gfx/size.h" |
| #include "url/gurl.h" |
| class PageUsageData; |
| -namespace content { |
| -class WebContents; |
| -} |
| - |
| namespace history { |
| // Forward declaration for friend statements. |
| @@ -44,12 +39,6 @@ typedef int64 FaviconBitmapID; // Identifier for a bitmap in a favicon. |
| typedef int64 SegmentID; // URL segments for the most visited view. |
| typedef int64 IconMappingID; // For page url and icon mapping. |
| -// Identifier for a context to scope page ids. (ContextIDs are used in |
| -// comparisons only and are never dereferenced.) |
| -// NB: The use of WebContents here is temporary; when the dependency on content |
| -// is broken, some other type will take its place. |
| -typedef content::WebContents* ContextID; |
| - |
| // The enumeration of all possible sources of visits is listed below. |
| // The source will be propagated along with a URL or a visit item |
| // and eventually be stored in the history database, |
| @@ -70,60 +59,6 @@ typedef int64 VisitID; |
| // Structure to hold the mapping between each visit's id and its source. |
| typedef std::map<VisitID, VisitSource> VisitSourceMap; |
| -// VisitRow ------------------------------------------------------------------- |
| - |
| -// Holds all information associated with a specific visit. A visit holds time |
| -// and referrer information for one time a URL is visited. |
| -class VisitRow { |
| - public: |
| - VisitRow(); |
| - VisitRow(URLID arg_url_id, |
| - base::Time arg_visit_time, |
| - VisitID arg_referring_visit, |
| - content::PageTransition arg_transition, |
| - SegmentID arg_segment_id); |
| - ~VisitRow(); |
| - |
| - // ID of this row (visit ID, used a a referrer for other visits). |
| - VisitID visit_id; |
| - |
| - // Row ID into the URL table of the URL that this page is. |
| - URLID url_id; |
| - |
| - base::Time visit_time; |
| - |
| - // Indicates another visit that was the referring page for this one. |
| - // 0 indicates no referrer. |
| - VisitID referring_visit; |
| - |
| - // A combination of bits from PageTransition. |
| - content::PageTransition transition; |
| - |
| - // The segment id (see visitsegment_database.*). |
| - // If 0, the segment id is null in the table. |
| - SegmentID segment_id; |
| - |
| - // Record how much time a user has this visit starting from the user |
| - // opened this visit to the user closed or ended this visit. |
| - // This includes both active and inactive time as long as |
| - // the visit was present. |
| - base::TimeDelta visit_duration; |
| - |
| - // Compares two visits based on dates, for sorting. |
| - bool operator<(const VisitRow& other) { |
| - return visit_time < other.visit_time; |
| - } |
| - |
| - // We allow the implicit copy constuctor and operator=. |
| -}; |
| - |
| -// We pass around vectors of visits a lot |
| -typedef std::vector<VisitRow> VisitVector; |
| - |
| -// The basic information associated with a visit (timestamp, type of visit), |
| -// used by HistoryBackend::AddVisits() to create new visits for a URL. |
| -typedef std::pair<base::Time, content::PageTransition> VisitInfo; |
| - |
| // PageVisit ------------------------------------------------------------------ |
| // Represents a simplified version of a visit for external users. Normally, |
| @@ -286,20 +221,6 @@ struct QueryOptions { |
| int64 EffectiveEndTime() const; |
| }; |
| -// QueryURLResult ------------------------------------------------------------- |
| - |
| -// QueryURLResult encapsulates the result of a call to HistoryBackend::QueryURL. |
| -struct QueryURLResult { |
| - QueryURLResult(); |
| - ~QueryURLResult(); |
| - |
| - // Indicates whether the call to HistoryBackend::QueryURL was successfull |
| - // or not. If false, then both |row| and |visits| fields are undefined. |
| - bool success; |
| - URLRow row; |
| - VisitVector visits; |
| -}; |
| - |
| // VisibleVisitCountToHostResult ---------------------------------------------- |
| // VisibleVisitCountToHostResult encapsulates the result of a call to |
| @@ -365,41 +286,6 @@ struct FilteredURL { |
| ExtendedInfo extended_info; |
| }; |
| -// Navigation ----------------------------------------------------------------- |
| - |
| -// Marshalling structure for AddPage. |
| -struct HistoryAddPageArgs { |
| - // The default constructor is equivalent to: |
| - // |
| - // HistoryAddPageArgs( |
| - // GURL(), base::Time(), NULL, 0, GURL(), |
| - // history::RedirectList(), content::PAGE_TRANSITION_LINK, |
| - // SOURCE_BROWSED, false) |
| - HistoryAddPageArgs(); |
| - HistoryAddPageArgs(const GURL& url, |
| - base::Time time, |
| - ContextID context_id, |
| - int32 page_id, |
| - const GURL& referrer, |
| - const history::RedirectList& redirects, |
| - content::PageTransition transition, |
| - VisitSource source, |
| - bool did_replace_entry); |
| - ~HistoryAddPageArgs(); |
| - |
| - GURL url; |
| - base::Time time; |
| - |
| - ContextID context_id; |
| - int32 page_id; |
| - |
| - GURL referrer; |
| - history::RedirectList redirects; |
| - content::PageTransition transition; |
| - VisitSource visit_source; |
| - bool did_replace_entry; |
| -}; |
| - |
| // TopSites ------------------------------------------------------------------- |
| typedef std::vector<MostVisitedURL> MostVisitedURLList; |
| @@ -517,20 +403,6 @@ struct FaviconBitmap { |
| gfx::Size pixel_size; |
| }; |
| -// Abbreviated information about a visit. |
| -struct BriefVisitInfo { |
| - URLID url_id; |
| - base::Time time; |
| - content::PageTransition transition; |
| -}; |
| - |
| -// An observer of VisitDatabase. |
| -class VisitDatabaseObserver { |
| - public: |
| - virtual ~VisitDatabaseObserver(); |
| - virtual void OnAddVisit(const BriefVisitInfo& info) = 0; |
| -}; |
| - |
| struct ExpireHistoryArgs { |
| ExpireHistoryArgs(); |
| ~ExpireHistoryArgs(); |
| @@ -546,4 +418,4 @@ struct ExpireHistoryArgs { |
| } // namespace history |
| -#endif // CHROME_BROWSER_HISTORY_HISTORY_TYPES_H_ |
| +#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_TYPES_H_ |