| OLD | NEW |
| 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 } | 310 } |
| 311 virtual void TabDeactivated(WebContents* contents) OVERRIDE { | 311 virtual void TabDeactivated(WebContents* contents) OVERRIDE { |
| 312 states_.push_back(State(contents, model()->active_index(), DEACTIVATE)); | 312 states_.push_back(State(contents, model()->active_index(), DEACTIVATE)); |
| 313 } | 313 } |
| 314 virtual void TabChangedAt(WebContents* contents, | 314 virtual void TabChangedAt(WebContents* contents, |
| 315 int index, | 315 int index, |
| 316 TabChangeType change_type) OVERRIDE { | 316 TabChangeType change_type) OVERRIDE { |
| 317 states_.push_back(State(contents, index, CHANGE)); | 317 states_.push_back(State(contents, index, CHANGE)); |
| 318 } | 318 } |
| 319 virtual void TabReplacedAt(TabStripModel* tab_strip_model, | 319 virtual void TabReplacedAt(TabStripModel* tab_strip_model, |
| 320 TabContents* old_contents, | 320 WebContents* old_contents, |
| 321 TabContents* new_contents, | 321 WebContents* new_contents, |
| 322 int index) OVERRIDE { | 322 int index) OVERRIDE { |
| 323 State s( | 323 State s(new_contents, index, REPLACED); |
| 324 new_contents ? new_contents->web_contents() : NULL, index, REPLACED); | 324 s.src_contents = old_contents; |
| 325 s.src_contents = old_contents ? old_contents->web_contents() : NULL; | |
| 326 states_.push_back(s); | 325 states_.push_back(s); |
| 327 } | 326 } |
| 328 virtual void TabPinnedStateChanged(WebContents* contents, | 327 virtual void TabPinnedStateChanged(WebContents* contents, |
| 329 int index) OVERRIDE { | 328 int index) OVERRIDE { |
| 330 states_.push_back(State(contents, index, PINNED)); | 329 states_.push_back(State(contents, index, PINNED)); |
| 331 } | 330 } |
| 332 virtual void TabStripEmpty() OVERRIDE { | 331 virtual void TabStripEmpty() OVERRIDE { |
| 333 empty_ = true; | 332 empty_ = true; |
| 334 } | 333 } |
| 335 | 334 |
| (...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2361 strip.ActivateTabAt(1, true); | 2360 strip.ActivateTabAt(1, true); |
| 2362 ASSERT_EQ(1, observer.GetStateCount()); | 2361 ASSERT_EQ(1, observer.GetStateCount()); |
| 2363 State s(contents2, 1, MockTabStripModelObserver::SELECT); | 2362 State s(contents2, 1, MockTabStripModelObserver::SELECT); |
| 2364 s.src_contents = contents2; | 2363 s.src_contents = contents2; |
| 2365 s.src_index = 1; | 2364 s.src_index = 1; |
| 2366 s.user_gesture = false; | 2365 s.user_gesture = false; |
| 2367 EXPECT_TRUE(observer.StateEquals(0, s)); | 2366 EXPECT_TRUE(observer.StateEquals(0, s)); |
| 2368 strip.RemoveObserver(&observer); | 2367 strip.RemoveObserver(&observer); |
| 2369 strip.CloseAllTabs(); | 2368 strip.CloseAllTabs(); |
| 2370 } | 2369 } |
| OLD | NEW |