| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
| 7 #include "chrome/browser/tab_contents/tab_contents.h" | 7 #include "chrome/browser/tab_contents/tab_contents.h" |
| 8 #include "chrome/browser/tab_contents/tab_contents_view.h" | 8 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 9 #include "chrome/browser/tabs/tab_strip_model.h" | 9 #include "chrome/browser/tabs/tab_strip_model.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 browser::NavigateParams p(MakeNavigateParams()); | 56 browser::NavigateParams p(MakeNavigateParams()); |
| 57 p.disposition = disposition; | 57 p.disposition = disposition; |
| 58 browser::Navigate(&p); | 58 browser::Navigate(&p); |
| 59 | 59 |
| 60 // Nothing should have happened as a result of Navigate(); | 60 // Nothing should have happened as a result of Navigate(); |
| 61 EXPECT_EQ(1, browser()->tab_count()); | 61 EXPECT_EQ(1, browser()->tab_count()); |
| 62 EXPECT_EQ(1u, BrowserList::size()); | 62 EXPECT_EQ(1u, BrowserList::size()); |
| 63 EXPECT_EQ(old_url, browser()->GetSelectedTabContents()->GetURL()); | 63 EXPECT_EQ(old_url, browser()->GetSelectedTabContents()->GetURL()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 // TODO(jhawkins): Remove once tabbed options are enabled by default. | |
| 67 virtual void SetUpCommandLine(CommandLine* command_line) { | |
| 68 command_line->AppendSwitch(switches::kEnableTabbedOptions); | |
| 69 } | |
| 70 | |
| 71 void Observe(NotificationType type, const NotificationSource& source, | 66 void Observe(NotificationType type, const NotificationSource& source, |
| 72 const NotificationDetails& details) { | 67 const NotificationDetails& details) { |
| 73 switch (type.value) { | 68 switch (type.value) { |
| 74 case NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB: { | 69 case NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB: { |
| 75 ++this->created_tab_contents_count_; | 70 ++this->created_tab_contents_count_; |
| 76 break; | 71 break; |
| 77 } | 72 } |
| 78 default: | 73 default: |
| 79 break; | 74 break; |
| 80 } | 75 } |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 // The middle tab should now be selected and navigated to the sub-page of the | 591 // The middle tab should now be selected and navigated to the sub-page of the |
| 597 // URL. | 592 // URL. |
| 598 EXPECT_EQ(browser(), p.browser); | 593 EXPECT_EQ(browser(), p.browser); |
| 599 EXPECT_EQ(3, browser()->tab_count()); | 594 EXPECT_EQ(3, browser()->tab_count()); |
| 600 EXPECT_EQ(1, browser()->selected_index()); | 595 EXPECT_EQ(1, browser()->selected_index()); |
| 601 EXPECT_EQ(GURL("chrome://settings/personal"), | 596 EXPECT_EQ(GURL("chrome://settings/personal"), |
| 602 browser()->GetSelectedTabContents()->GetURL()); | 597 browser()->GetSelectedTabContents()->GetURL()); |
| 603 } | 598 } |
| 604 | 599 |
| 605 } // namespace | 600 } // namespace |
| OLD | NEW |