| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "chrome/browser/defaults.h" | 18 #include "chrome/browser/defaults.h" |
| 19 #include "chrome/browser/extensions/tab_helper.h" | 19 #include "chrome/browser/extensions/tab_helper.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/browser/ui/browser_tabstrip.h" | 22 #include "chrome/browser/ui/browser_tabstrip.h" |
| 23 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 23 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
| 24 #include "chrome/browser/ui/tabs/tab_strip_model_order_controller.h" | 24 #include "chrome/browser/ui/tabs/tab_strip_model_order_controller.h" |
| 25 #include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h" | 25 #include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h" |
| 26 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 26 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 27 #include "chrome/common/extensions/extension.h" | |
| 28 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 29 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 28 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 30 #include "chrome/test/base/testing_profile.h" | 29 #include "chrome/test/base/testing_profile.h" |
| 31 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 30 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 32 #include "content/public/browser/navigation_controller.h" | 31 #include "content/public/browser/navigation_controller.h" |
| 33 #include "content/public/browser/navigation_entry.h" | 32 #include "content/public/browser/navigation_entry.h" |
| 34 #include "content/public/browser/render_process_host.h" | 33 #include "content/public/browser/render_process_host.h" |
| 35 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
| 36 #include "content/public/browser/web_contents_observer.h" | 35 #include "content/public/browser/web_contents_observer.h" |
| 36 #include "extensions/common/extension.h" |
| 37 #include "testing/gtest/include/gtest/gtest.h" | 37 #include "testing/gtest/include/gtest/gtest.h" |
| 38 | 38 |
| 39 using content::SiteInstance; | 39 using content::SiteInstance; |
| 40 using content::WebContents; | 40 using content::WebContents; |
| 41 using extensions::Extension; | 41 using extensions::Extension; |
| 42 using web_modal::NativeWebContentsModalDialog; | 42 using web_modal::NativeWebContentsModalDialog; |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 // Class used to delete a WebContents and TabStripModel when another WebContents | 46 // Class used to delete a WebContents and TabStripModel when another WebContents |
| (...skipping 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2532 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); | 2532 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); |
| 2533 EXPECT_EQ(contents2, moved_contents); | 2533 EXPECT_EQ(contents2, moved_contents); |
| 2534 | 2534 |
| 2535 // Attach the tab to the destination tab strip. | 2535 // Attach the tab to the destination tab strip. |
| 2536 strip_dst.AppendWebContents(moved_contents, true); | 2536 strip_dst.AppendWebContents(moved_contents, true); |
| 2537 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); | 2537 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); |
| 2538 | 2538 |
| 2539 strip_dst.CloseAllTabs(); | 2539 strip_dst.CloseAllTabs(); |
| 2540 strip_src.CloseAllTabs(); | 2540 strip_src.CloseAllTabs(); |
| 2541 } | 2541 } |
| OLD | NEW |