| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/stl_util-inl.h" | 12 #include "base/stl_util-inl.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/string_split.h" | 14 #include "base/string_split.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "chrome/browser/defaults.h" | 17 #include "chrome/browser/defaults.h" |
| 18 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
| 20 #include "chrome/browser/tabs/tab_strip_model.h" | 21 #include "chrome/browser/tabs/tab_strip_model.h" |
| 21 #include "chrome/browser/tabs/tab_strip_model_delegate.h" | 22 #include "chrome/browser/tabs/tab_strip_model_delegate.h" |
| 22 #include "chrome/browser/tabs/tab_strip_model_order_controller.h" | 23 #include "chrome/browser/tabs/tab_strip_model_order_controller.h" |
| 23 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
| 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 25 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 25 #include "chrome/browser/ui/webui/new_tab_ui.h" | 26 #include "chrome/browser/ui/webui/new_tab_ui.h" |
| 26 #include "chrome/common/extensions/extension.h" | 27 #include "chrome/common/extensions/extension.h" |
| 27 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| (...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 | 1753 |
| 1753 #if defined(OS_WIN) | 1754 #if defined(OS_WIN) |
| 1754 FilePath path(FILE_PATH_LITERAL("c:\\foo")); | 1755 FilePath path(FILE_PATH_LITERAL("c:\\foo")); |
| 1755 #elif defined(OS_POSIX) | 1756 #elif defined(OS_POSIX) |
| 1756 FilePath path(FILE_PATH_LITERAL("/foo")); | 1757 FilePath path(FILE_PATH_LITERAL("/foo")); |
| 1757 #endif | 1758 #endif |
| 1758 scoped_refptr<Extension> extension_app(new Extension(path, | 1759 scoped_refptr<Extension> extension_app(new Extension(path, |
| 1759 Extension::INVALID)); | 1760 Extension::INVALID)); |
| 1760 extension_app->launch_web_url_ = "http://www.google.com"; | 1761 extension_app->launch_web_url_ = "http://www.google.com"; |
| 1761 TabContentsWrapper* contents1 = CreateTabContents(); | 1762 TabContentsWrapper* contents1 = CreateTabContents(); |
| 1762 contents1->tab_contents()->SetExtensionApp(extension_app); | 1763 contents1->extension_tab_helper()->SetExtensionApp(extension_app); |
| 1763 TabContentsWrapper* contents2 = CreateTabContents(); | 1764 TabContentsWrapper* contents2 = CreateTabContents(); |
| 1764 contents2->tab_contents()->SetExtensionApp(extension_app); | 1765 contents2->extension_tab_helper()->SetExtensionApp(extension_app); |
| 1765 TabContentsWrapper* contents3 = CreateTabContents(); | 1766 TabContentsWrapper* contents3 = CreateTabContents(); |
| 1766 | 1767 |
| 1767 SetID(contents1->tab_contents(), 1); | 1768 SetID(contents1->tab_contents(), 1); |
| 1768 SetID(contents2->tab_contents(), 2); | 1769 SetID(contents2->tab_contents(), 2); |
| 1769 SetID(contents3->tab_contents(), 3); | 1770 SetID(contents3->tab_contents(), 3); |
| 1770 | 1771 |
| 1771 // Note! The ordering of these tests is important, each subsequent test | 1772 // Note! The ordering of these tests is important, each subsequent test |
| 1772 // builds on the state established in the previous. This is important if you | 1773 // builds on the state established in the previous. This is important if you |
| 1773 // ever insert tests rather than append. | 1774 // ever insert tests rather than append. |
| 1774 | 1775 |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2194 strip.SelectTabContentsAt(1, true); | 2195 strip.SelectTabContentsAt(1, true); |
| 2195 ASSERT_EQ(1, observer.GetStateCount()); | 2196 ASSERT_EQ(1, observer.GetStateCount()); |
| 2196 MockTabStripModelObserver::State s( | 2197 MockTabStripModelObserver::State s( |
| 2197 contents2, 1, MockTabStripModelObserver::SELECT); | 2198 contents2, 1, MockTabStripModelObserver::SELECT); |
| 2198 s.src_contents = contents2; | 2199 s.src_contents = contents2; |
| 2199 s.user_gesture = true; | 2200 s.user_gesture = true; |
| 2200 EXPECT_TRUE(observer.StateEquals(0, s)); | 2201 EXPECT_TRUE(observer.StateEquals(0, s)); |
| 2201 strip.RemoveObserver(&observer); | 2202 strip.RemoveObserver(&observer); |
| 2202 strip.CloseAllTabs(); | 2203 strip.CloseAllTabs(); |
| 2203 } | 2204 } |
| OLD | NEW |