Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: chrome/browser/tabs/tab_strip_selection_model.cc

Issue 7033048: Multi-tab: Adding new Notification when tab selection changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments. Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698