OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "chrome/browser/dock_info.h" | 7 #include "chrome/browser/dock_info.h" |
8 #include "chrome/browser/dom_ui/new_tab_ui.h" | 8 #include "chrome/browser/dom_ui/new_tab_ui.h" |
9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
10 #include "chrome/browser/profile_manager.h" | 10 #include "chrome/browser/profile_manager.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 const TabContentsType kReplacementContentsType = | 23 const TabContentsType kReplacementContentsType = |
24 static_cast<TabContentsType>(kHTTPTabContentsType + 1); | 24 static_cast<TabContentsType>(kHTTPTabContentsType + 1); |
25 | 25 |
26 class TabStripDummyDelegate : public TabStripModelDelegate { | 26 class TabStripDummyDelegate : public TabStripModelDelegate { |
27 public: | 27 public: |
28 explicit TabStripDummyDelegate(TabContents* dummy) | 28 explicit TabStripDummyDelegate(TabContents* dummy) |
29 : dummy_contents_(dummy) {} | 29 : dummy_contents_(dummy) {} |
30 virtual ~TabStripDummyDelegate() {} | 30 virtual ~TabStripDummyDelegate() {} |
31 | 31 |
32 // Overridden from TabStripModelDelegate: | 32 // Overridden from TabStripModelDelegate: |
33 virtual GURL GetBlankTabURL() const { return NewTabUIURL(); } | 33 virtual GURL GetBlankTabURL() const { return NewTabUI::GetBaseURL(); } |
34 virtual void CreateNewStripWithContents(TabContents* contents, | 34 virtual void CreateNewStripWithContents(TabContents* contents, |
35 const gfx::Rect& window_bounds, | 35 const gfx::Rect& window_bounds, |
36 const DockInfo& dock_info) {} | 36 const DockInfo& dock_info) {} |
37 virtual int GetDragActions() const { return 0; } | 37 virtual int GetDragActions() const { return 0; } |
38 virtual TabContents* CreateTabContentsForURL( | 38 virtual TabContents* CreateTabContentsForURL( |
39 const GURL& url, | 39 const GURL& url, |
40 const GURL& referrer, | 40 const GURL& referrer, |
41 Profile* profile, | 41 Profile* profile, |
42 PageTransition::Type transition, | 42 PageTransition::Type transition, |
43 bool defer_load, | 43 bool defer_load, |
44 SiteInstance* instance) const { | 44 SiteInstance* instance) const { |
45 if (url == NewTabUIURL()) | 45 if (url == NewTabUI::GetBaseURL()) |
46 return dummy_contents_; | 46 return dummy_contents_; |
47 return NULL; | 47 return NULL; |
48 } | 48 } |
49 virtual bool CanDuplicateContentsAt(int index) { return false; } | 49 virtual bool CanDuplicateContentsAt(int index) { return false; } |
50 virtual void DuplicateContentsAt(int index) {} | 50 virtual void DuplicateContentsAt(int index) {} |
51 virtual void CloseFrameAfterDragSession() {} | 51 virtual void CloseFrameAfterDragSession() {} |
52 virtual void CreateHistoricalTab(TabContents* contents) {} | 52 virtual void CreateHistoricalTab(TabContents* contents) {} |
53 virtual bool RunUnloadListenerBeforeClosing(TabContents* contents) { | 53 virtual bool RunUnloadListenerBeforeClosing(TabContents* contents) { |
54 return false; | 54 return false; |
55 } | 55 } |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1282 // Now select the last tab. | 1282 // Now select the last tab. |
1283 strip.SelectTabContentsAt(strip.count() - 1, true); | 1283 strip.SelectTabContentsAt(strip.count() - 1, true); |
1284 | 1284 |
1285 // Now close the last tab. The next adjacent should be selected. | 1285 // Now close the last tab. The next adjacent should be selected. |
1286 strip.CloseTabContentsAt(strip.count() - 1); | 1286 strip.CloseTabContentsAt(strip.count() - 1); |
1287 EXPECT_EQ(page_d_contents, strip.GetTabContentsAt(strip.selected_index())); | 1287 EXPECT_EQ(page_d_contents, strip.GetTabContentsAt(strip.selected_index())); |
1288 | 1288 |
1289 strip.CloseAllTabs(); | 1289 strip.CloseAllTabs(); |
1290 } | 1290 } |
1291 | 1291 |
OLD | NEW |