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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "chrome/browser/defaults.h" | 21 #include "chrome/browser/defaults.h" |
22 #include "chrome/browser/extensions/tab_helper.h" | 22 #include "chrome/browser/extensions/tab_helper.h" |
23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
(...skipping 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2470 web_modal::WebContentsModalDialogManager::FromWebContents(contents2); | 2470 web_modal::WebContentsModalDialogManager::FromWebContents(contents2); |
2471 | 2471 |
2472 // Show a dialog that blocks tab |contents2|. | 2472 // Show a dialog that blocks tab |contents2|. |
2473 // DummySingleWebContentsDialogManager doesn't care about the | 2473 // DummySingleWebContentsDialogManager doesn't care about the |
2474 // dialog window value, so any dummy value works. | 2474 // dialog window value, so any dummy value works. |
2475 DummySingleWebContentsDialogManager* native_manager = | 2475 DummySingleWebContentsDialogManager* native_manager = |
2476 new DummySingleWebContentsDialogManager( | 2476 new DummySingleWebContentsDialogManager( |
2477 reinterpret_cast<gfx::NativeWindow>(0), modal_dialog_manager); | 2477 reinterpret_cast<gfx::NativeWindow>(0), modal_dialog_manager); |
2478 modal_dialog_manager->ShowDialogWithManager( | 2478 modal_dialog_manager->ShowDialogWithManager( |
2479 reinterpret_cast<gfx::NativeWindow>(0), | 2479 reinterpret_cast<gfx::NativeWindow>(0), |
2480 scoped_ptr<web_modal::SingleWebContentsDialogManager>(native_manager)); | 2480 std::unique_ptr<web_modal::SingleWebContentsDialogManager>( |
| 2481 native_manager)); |
2481 EXPECT_TRUE(strip_src.IsTabBlocked(1)); | 2482 EXPECT_TRUE(strip_src.IsTabBlocked(1)); |
2482 | 2483 |
2483 // Detach the tab. | 2484 // Detach the tab. |
2484 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); | 2485 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); |
2485 EXPECT_EQ(contents2, moved_contents); | 2486 EXPECT_EQ(contents2, moved_contents); |
2486 | 2487 |
2487 // Attach the tab to the destination tab strip. | 2488 // Attach the tab to the destination tab strip. |
2488 strip_dst.AppendWebContents(moved_contents, true); | 2489 strip_dst.AppendWebContents(moved_contents, true); |
2489 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); | 2490 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); |
2490 | 2491 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2539 strip.AddObserver(&observer); | 2540 strip.AddObserver(&observer); |
2540 | 2541 |
2541 strip.ActivateTabAt(1, true); | 2542 strip.ActivateTabAt(1, true); |
2542 EXPECT_EQ(1, strip.active_index()); | 2543 EXPECT_EQ(1, strip.active_index()); |
2543 | 2544 |
2544 strip.MoveWebContentsAt(2, 3, true); | 2545 strip.MoveWebContentsAt(2, 3, true); |
2545 EXPECT_EQ(3, strip.active_index()); | 2546 EXPECT_EQ(3, strip.active_index()); |
2546 | 2547 |
2547 strip.CloseAllTabs(); | 2548 strip.CloseAllTabs(); |
2548 } | 2549 } |
OLD | NEW |