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 #include "components/history/core/browser/url_row.h" | 5 #include "components/history/core/browser/url_row.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 namespace history { | 9 namespace history { |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 | 29 |
30 URLRow& URLRow::operator=(const URLRow& other) { | 30 URLRow& URLRow::operator=(const URLRow& other) { |
31 id_ = other.id_; | 31 id_ = other.id_; |
32 url_ = other.url_; | 32 url_ = other.url_; |
33 title_ = other.title_; | 33 title_ = other.title_; |
34 visit_count_ = other.visit_count_; | 34 visit_count_ = other.visit_count_; |
35 typed_count_ = other.typed_count_; | 35 typed_count_ = other.typed_count_; |
36 last_visit_ = other.last_visit_; | 36 last_visit_ = other.last_visit_; |
37 hidden_ = other.hidden_; | 37 hidden_ = other.hidden_; |
| 38 context_ = other.context_; |
38 return *this; | 39 return *this; |
39 } | 40 } |
40 | 41 |
41 void URLRow::Swap(URLRow* other) { | 42 void URLRow::Swap(URLRow* other) { |
42 std::swap(id_, other->id_); | 43 std::swap(id_, other->id_); |
43 url_.Swap(&other->url_); | 44 url_.Swap(&other->url_); |
44 title_.swap(other->title_); | 45 title_.swap(other->title_); |
45 std::swap(visit_count_, other->visit_count_); | 46 std::swap(visit_count_, other->visit_count_); |
46 std::swap(typed_count_, other->typed_count_); | 47 std::swap(typed_count_, other->typed_count_); |
47 std::swap(last_visit_, other->last_visit_); | 48 std::swap(last_visit_, other->last_visit_); |
48 std::swap(hidden_, other->hidden_); | 49 std::swap(hidden_, other->hidden_); |
| 50 std::swap(context_, other->context_); |
49 } | 51 } |
50 | 52 |
51 void URLRow::Initialize() { | 53 void URLRow::Initialize() { |
52 id_ = 0; | 54 id_ = 0; |
53 visit_count_ = 0; | 55 visit_count_ = 0; |
54 typed_count_ = 0; | 56 typed_count_ = 0; |
55 last_visit_ = base::Time(); | 57 last_visit_ = base::Time(); |
56 hidden_ = false; | 58 hidden_ = false; |
| 59 context_ = CONTEXT_NONE; |
57 } | 60 } |
58 | 61 |
59 | 62 |
60 URLResult::URLResult() | 63 URLResult::URLResult() |
61 : blocked_visit_(false) { | 64 : blocked_visit_(false) { |
62 } | 65 } |
63 | 66 |
64 URLResult::URLResult(const GURL& url, base::Time visit_time) | 67 URLResult::URLResult(const GURL& url, base::Time visit_time) |
65 : URLRow(url), | 68 : URLRow(url), |
66 visit_time_(visit_time), | 69 visit_time_(visit_time), |
(...skipping 20 matching lines...) Expand all Loading... |
87 title_match_positions_.swap(other->title_match_positions_); | 90 title_match_positions_.swap(other->title_match_positions_); |
88 std::swap(blocked_visit_, other->blocked_visit_); | 91 std::swap(blocked_visit_, other->blocked_visit_); |
89 } | 92 } |
90 | 93 |
91 // static | 94 // static |
92 bool URLResult::CompareVisitTime(const URLResult& lhs, const URLResult& rhs) { | 95 bool URLResult::CompareVisitTime(const URLResult& lhs, const URLResult& rhs) { |
93 return lhs.visit_time() > rhs.visit_time(); | 96 return lhs.visit_time() > rhs.visit_time(); |
94 } | 97 } |
95 | 98 |
96 } // namespace history | 99 } // namespace history |
OLD | NEW |