Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: chrome/browser/tabs/tab_strip_model_unittest.cc

Issue 28104: Enable history and downloads by default, port NewTabUI from DOMUIHost to DOMU... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_factory.cc ('k') | chrome/browser/views/download_shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698