OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_URL_ROW_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_URL_ROW_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_URL_ROW_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_URL_ROW_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class URLRow { | 31 class URLRow { |
32 public: | 32 public: |
33 URLRow(); | 33 URLRow(); |
34 | 34 |
35 explicit URLRow(const GURL& url); | 35 explicit URLRow(const GURL& url); |
36 | 36 |
37 // We need to be able to set the id of a URLRow that's being passed through | 37 // We need to be able to set the id of a URLRow that's being passed through |
38 // an IPC message. This constructor should probably not be used otherwise. | 38 // an IPC message. This constructor should probably not be used otherwise. |
39 URLRow(const GURL& url, URLID id); | 39 URLRow(const GURL& url, URLID id); |
40 | 40 |
| 41 URLRow(const URLRow& other); |
| 42 |
41 virtual ~URLRow(); | 43 virtual ~URLRow(); |
42 URLRow& operator=(const URLRow& other); | 44 URLRow& operator=(const URLRow& other); |
43 | 45 |
44 URLID id() const { return id_; } | 46 URLID id() const { return id_; } |
45 | 47 |
46 // Sets the id of the row. The id should only be manually set when a row has | 48 // Sets the id of the row. The id should only be manually set when a row has |
47 // been retrieved from the history database or other dataset based on criteria | 49 // been retrieved from the history database or other dataset based on criteria |
48 // other than its id (i.e. by URL) and when the id has not yet been set in the | 50 // other than its id (i.e. by URL) and when the id has not yet been set in the |
49 // row. | 51 // row. |
50 void set_id(URLID id) { id_ = id; } | 52 void set_id(URLID id) { id_ = id; } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 163 |
162 class URLResult : public URLRow { | 164 class URLResult : public URLRow { |
163 public: | 165 public: |
164 URLResult(); | 166 URLResult(); |
165 URLResult(const GURL& url, base::Time visit_time); | 167 URLResult(const GURL& url, base::Time visit_time); |
166 // Constructor that create a URLResult from the specified URL and title match | 168 // Constructor that create a URLResult from the specified URL and title match |
167 // positions from title_matches. | 169 // positions from title_matches. |
168 URLResult(const GURL& url, | 170 URLResult(const GURL& url, |
169 const query_parser::Snippet::MatchPositions& title_matches); | 171 const query_parser::Snippet::MatchPositions& title_matches); |
170 explicit URLResult(const URLRow& url_row); | 172 explicit URLResult(const URLRow& url_row); |
| 173 URLResult(const URLResult& other); |
171 ~URLResult() override; | 174 ~URLResult() override; |
172 | 175 |
173 base::Time visit_time() const { return visit_time_; } | 176 base::Time visit_time() const { return visit_time_; } |
174 void set_visit_time(base::Time visit_time) { visit_time_ = visit_time; } | 177 void set_visit_time(base::Time visit_time) { visit_time_ = visit_time; } |
175 | 178 |
176 const query_parser::Snippet& snippet() const { return snippet_; } | 179 const query_parser::Snippet& snippet() const { return snippet_; } |
177 | 180 |
178 bool blocked_visit() const { return blocked_visit_; } | 181 bool blocked_visit() const { return blocked_visit_; } |
179 void set_blocked_visit(bool blocked_visit) { | 182 void set_blocked_visit(bool blocked_visit) { |
180 blocked_visit_ = blocked_visit; | 183 blocked_visit_ = blocked_visit; |
(...skipping 22 matching lines...) Expand all Loading... |
203 | 206 |
204 // Whether a managed user was blocked when attempting to visit this URL. | 207 // Whether a managed user was blocked when attempting to visit this URL. |
205 bool blocked_visit_; | 208 bool blocked_visit_; |
206 | 209 |
207 // We support the implicit copy constructor and operator=. | 210 // We support the implicit copy constructor and operator=. |
208 }; | 211 }; |
209 | 212 |
210 } // namespace history | 213 } // namespace history |
211 | 214 |
212 #endif // COMPONENTS_HISTORY_CORE_BROWSER_URL_ROW_H_ | 215 #endif // COMPONENTS_HISTORY_CORE_BROWSER_URL_ROW_H_ |
OLD | NEW |