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

Side by Side Diff: chrome/browser/ui/tabs/tab_strip_model_unittest.cc

Issue 11365201: Remove TabContents from TabStripModelObserver::TabMoved. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: linux oops Created 8 years, 1 month 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/tabs/tab_strip_model.h" 5 #include "chrome/browser/ui/tabs/tab_strip_model.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 states_.push_back(s); 286 states_.push_back(s);
287 } 287 }
288 virtual void TabSelectionChanged( 288 virtual void TabSelectionChanged(
289 TabStripModel* tab_strip_model, 289 TabStripModel* tab_strip_model,
290 const TabStripSelectionModel& old_model) OVERRIDE { 290 const TabStripSelectionModel& old_model) OVERRIDE {
291 State s(model()->GetActiveWebContents(), model()->active_index(), SELECT); 291 State s(model()->GetActiveWebContents(), model()->active_index(), SELECT);
292 s.src_contents = model()->GetWebContentsAt(old_model.active()); 292 s.src_contents = model()->GetWebContentsAt(old_model.active());
293 s.src_index = old_model.active(); 293 s.src_index = old_model.active();
294 states_.push_back(s); 294 states_.push_back(s);
295 } 295 }
296 virtual void TabMoved(TabContents* contents, 296 virtual void TabMoved(WebContents* contents,
297 int from_index, 297 int from_index,
298 int to_index) OVERRIDE { 298 int to_index) OVERRIDE {
299 State s(contents ? contents->web_contents() : NULL, to_index, MOVE); 299 State s(contents, to_index, MOVE);
300 s.src_index = from_index; 300 s.src_index = from_index;
301 states_.push_back(s); 301 states_.push_back(s);
302 } 302 }
303 303
304 virtual void TabClosingAt(TabStripModel* tab_strip_model, 304 virtual void TabClosingAt(TabStripModel* tab_strip_model,
305 WebContents* contents, 305 WebContents* contents,
306 int index) OVERRIDE { 306 int index) OVERRIDE {
307 states_.push_back(State(contents, index, CLOSE)); 307 states_.push_back(State(contents, index, CLOSE));
308 } 308 }
309 virtual void TabDetachedAt(WebContents* contents, int index) OVERRIDE { 309 virtual void TabDetachedAt(WebContents* contents, int index) OVERRIDE {
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after
2409 strip.ActivateTabAt(1, true); 2409 strip.ActivateTabAt(1, true);
2410 ASSERT_EQ(1, observer.GetStateCount()); 2410 ASSERT_EQ(1, observer.GetStateCount());
2411 State s(contents2, 1, MockTabStripModelObserver::SELECT); 2411 State s(contents2, 1, MockTabStripModelObserver::SELECT);
2412 s.src_contents = contents2; 2412 s.src_contents = contents2;
2413 s.src_index = 1; 2413 s.src_index = 1;
2414 s.user_gesture = false; 2414 s.user_gesture = false;
2415 EXPECT_TRUE(observer.StateEquals(0, s)); 2415 EXPECT_TRUE(observer.StateEquals(0, s));
2416 strip.RemoveObserver(&observer); 2416 strip.RemoveObserver(&observer);
2417 strip.CloseAllTabs(); 2417 strip.CloseAllTabs();
2418 } 2418 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model_observer.cc ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698