OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/tabs/tab_strip_selection_model.h" | 5 #include "chrome/browser/tabs/tab_strip_selection_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <valarray> | 8 #include <valarray> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 anchor_ = active_ = kUnselectedIndex; | 132 anchor_ = active_ = kUnselectedIndex; |
133 SelectedIndices empty_selection; | 133 SelectedIndices empty_selection; |
134 selected_indices_.swap(empty_selection); | 134 selected_indices_.swap(empty_selection); |
135 } | 135 } |
136 | 136 |
137 void TabStripSelectionModel::Copy(const TabStripSelectionModel& source) { | 137 void TabStripSelectionModel::Copy(const TabStripSelectionModel& source) { |
138 selected_indices_ = source.selected_indices_; | 138 selected_indices_ = source.selected_indices_; |
139 active_ = source.active_; | 139 active_ = source.active_; |
140 anchor_ = source.anchor_; | 140 anchor_ = source.anchor_; |
141 } | 141 } |
142 | |
143 bool TabStripSelectionModel::Equals(const TabStripSelectionModel& rhs) const { | |
144 return active_ == rhs.active() && | |
145 anchor_ == rhs.anchor() && | |
146 selected_indices().size() == rhs.selected_indices().size() && | |
sky
2011/06/03 15:35:56
can't use use == for comparing the two vectors?
dpapad
2011/06/03 17:49:01
Done.
| |
147 std::equal(selected_indices().begin(), | |
148 selected_indices().end(), | |
149 rhs.selected_indices().begin()); | |
150 } | |
OLD | NEW |