OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_model_order_controller.h" | 5 #include "chrome/browser/tabs/tab_strip_model_order_controller.h" |
6 | 6 |
7 #include "chrome/browser/tab_contents_wrapper.h" | 7 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
8 | 8 |
9 /////////////////////////////////////////////////////////////////////////////// | 9 /////////////////////////////////////////////////////////////////////////////// |
10 // TabStripModelOrderController, public: | 10 // TabStripModelOrderController, public: |
11 | 11 |
12 TabStripModelOrderController::TabStripModelOrderController( | 12 TabStripModelOrderController::TabStripModelOrderController( |
13 TabStripModel* tabstrip) | 13 TabStripModel* tabstrip) |
14 : tabstrip_(tabstrip), | 14 : tabstrip_(tabstrip), |
15 insertion_policy_(TabStripModel::INSERT_AFTER) { | 15 insertion_policy_(TabStripModel::INSERT_AFTER) { |
16 tabstrip_->AddObserver(this); | 16 tabstrip_->AddObserver(this); |
17 } | 17 } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 /////////////////////////////////////////////////////////////////////////////// | 133 /////////////////////////////////////////////////////////////////////////////// |
134 // TabStripModelOrderController, private: | 134 // TabStripModelOrderController, private: |
135 | 135 |
136 int TabStripModelOrderController::GetValidIndex( | 136 int TabStripModelOrderController::GetValidIndex( |
137 int index, int removing_index) const { | 137 int index, int removing_index) const { |
138 if (removing_index < index) | 138 if (removing_index < index) |
139 index = std::max(0, index - 1); | 139 index = std::max(0, index - 1); |
140 return index; | 140 return index; |
141 } | 141 } |
OLD | NEW |