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

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

Issue 6155003: Changes instant so that the newly created tab has a new id. Doing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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) 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.h" 5 #include "chrome/browser/tabs/tab_strip_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 int index, 169 int index,
170 TabContentsWrapper* new_contents) { 170 TabContentsWrapper* new_contents) {
171 // TODO: this should reset group/opener of any tabs that point at 171 // TODO: this should reset group/opener of any tabs that point at
172 // old_contents. 172 // old_contents.
173 DCHECK(ContainsIndex(index)); 173 DCHECK(ContainsIndex(index));
174 TabContentsWrapper* old_contents = GetContentsAt(index); 174 TabContentsWrapper* old_contents = GetContentsAt(index);
175 175
176 contents_data_[index]->contents = new_contents; 176 contents_data_[index]->contents = new_contents;
177 177
178 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, 178 FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
179 TabReplacedAt(old_contents, new_contents, index)); 179 TabReplacedAt(this, old_contents, new_contents, index));
180 180
181 // When the selected tab contents is replaced send out selected notification 181 // When the selected tab contents is replaced send out selected notification
182 // too. We do this as nearly all observers need to treat a replace of the 182 // too. We do this as nearly all observers need to treat a replace of the
183 // selected contents as selection changing. 183 // selected contents as selection changing.
184 if (selected_index_ == index) { 184 if (selected_index_ == index) {
185 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, 185 FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
186 TabSelectedAt(old_contents, new_contents, 186 TabSelectedAt(old_contents, new_contents,
187 selected_index_, false)); 187 selected_index_, false));
188 } 188 }
189 return old_contents; 189 return old_contents;
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, 1004 FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
1005 TabMoved(moved_data->contents, index, to_position)); 1005 TabMoved(moved_data->contents, index, to_position));
1006 } 1006 }
1007 1007
1008 // static 1008 // static
1009 bool TabStripModel::OpenerMatches(const TabContentsData* data, 1009 bool TabStripModel::OpenerMatches(const TabContentsData* data,
1010 const NavigationController* opener, 1010 const NavigationController* opener,
1011 bool use_group) { 1011 bool use_group) {
1012 return data->opener == opener || (use_group && data->group == opener); 1012 return data->opener == opener || (use_group && data->group == opener);
1013 } 1013 }
OLDNEW
« no previous file with comments | « chrome/browser/tabs/default_tab_handler.cc ('k') | chrome/browser/tabs/tab_strip_model_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698