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

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

Issue 7043020: Multi-tab selection: Renaming TabStripModelObserver::TabSelectedAt to ActiveTabChanged (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updating TODO comments Created 9 years, 7 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_model_order_controller.h" 5 #include "chrome/browser/tabs/tab_strip_model_order_controller.h"
6 6
7 #include "chrome/browser/ui/tab_contents/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:
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 // No opener set, fall through to the default handler... 101 // No opener set, fall through to the default handler...
102 int selected_index = tabstrip_->active_index(); 102 int selected_index = tabstrip_->active_index();
103 if (selected_index >= (tab_count - 1)) 103 if (selected_index >= (tab_count - 1))
104 return selected_index - 1; 104 return selected_index - 1;
105 105
106 return selected_index; 106 return selected_index;
107 } 107 }
108 108
109 void TabStripModelOrderController::TabSelectedAt( 109 void TabStripModelOrderController::ActiveTabChanged(
110 TabContentsWrapper* old_contents, 110 TabContentsWrapper* old_contents,
111 TabContentsWrapper* new_contents, 111 TabContentsWrapper* new_contents,
112 int index, 112 int index,
113 bool user_gesture) { 113 bool user_gesture) {
114 if (old_contents == new_contents) 114 if (old_contents == new_contents)
115 return; 115 return;
116 116
117 NavigationController* old_opener = NULL; 117 NavigationController* old_opener = NULL;
118 if (old_contents) { 118 if (old_contents) {
119 int index = tabstrip_->GetIndexOfTabContents(old_contents); 119 int index = tabstrip_->GetIndexOfTabContents(old_contents);
(...skipping 17 matching lines...) Expand all
137 137
138 /////////////////////////////////////////////////////////////////////////////// 138 ///////////////////////////////////////////////////////////////////////////////
139 // TabStripModelOrderController, private: 139 // TabStripModelOrderController, private:
140 140
141 int TabStripModelOrderController::GetValidIndex( 141 int TabStripModelOrderController::GetValidIndex(
142 int index, int removing_index) const { 142 int index, int removing_index) const {
143 if (removing_index < index) 143 if (removing_index < index)
144 index = std::max(0, index - 1); 144 index = std::max(0, index - 1);
145 return index; 145 return index;
146 } 146 }
OLDNEW
« no previous file with comments | « chrome/browser/tabs/tab_strip_model_order_controller.h ('k') | chrome/browser/tabs/tab_strip_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698