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

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

Issue 8186: Plumb the referrer throughout the OpenURL APIs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | chrome/browser/task_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dom_ui/new_tab_ui.h" 7 #include "chrome/browser/dom_ui/new_tab_ui.h"
8 #include "chrome/browser/navigation_controller.h" 8 #include "chrome/browser/navigation_controller.h"
9 #include "chrome/browser/navigation_entry.h" 9 #include "chrome/browser/navigation_entry.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 TabContents* CreateNewTabTabContents() { 101 TabContents* CreateNewTabTabContents() {
102 TabStripModelTestTabContents* contents = 102 TabStripModelTestTabContents* contents =
103 new TabStripModelTestTabContents(TAB_CONTENTS_NEW_TAB_UI); 103 new TabStripModelTestTabContents(TAB_CONTENTS_NEW_TAB_UI);
104 contents->SetupController(profile_); 104 contents->SetupController(profile_);
105 return contents; 105 return contents;
106 } 106 }
107 107
108 // Forwards a URL "load" request through to our dummy TabContents 108 // Forwards a URL "load" request through to our dummy TabContents
109 // implementation. 109 // implementation.
110 void LoadURL(TabContents* contents, const std::wstring& url) { 110 void LoadURL(TabContents* contents, const std::wstring& url) {
111 contents->controller()->LoadURL(GURL(url), PageTransition::LINK); 111 contents->controller()->LoadURL(GURL(url), GURL(), PageTransition::LINK);
112 } 112 }
113 113
114 void GoBack(TabContents* contents) { 114 void GoBack(TabContents* contents) {
115 contents->controller()->GoBack(); 115 contents->controller()->GoBack();
116 } 116 }
117 117
118 void GoForward(TabContents* contents) { 118 void GoForward(TabContents* contents) {
119 contents->controller()->GoForward(); 119 contents->controller()->GoForward();
120 } 120 }
121 121
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 explicit TabStripDummyDelegate(TabContents* dummy) 990 explicit TabStripDummyDelegate(TabContents* dummy)
991 : dummy_contents_(dummy) {} 991 : dummy_contents_(dummy) {}
992 virtual ~TabStripDummyDelegate() {} 992 virtual ~TabStripDummyDelegate() {}
993 993
994 // Overridden from TabStripModelDelegate: 994 // Overridden from TabStripModelDelegate:
995 virtual void CreateNewStripWithContents(TabContents* contents, 995 virtual void CreateNewStripWithContents(TabContents* contents,
996 const gfx::Point& creation_point) {} 996 const gfx::Point& creation_point) {}
997 virtual int GetDragActions() const { return 0; } 997 virtual int GetDragActions() const { return 0; }
998 virtual TabContents* CreateTabContentsForURL( 998 virtual TabContents* CreateTabContentsForURL(
999 const GURL& url, 999 const GURL& url,
1000 const GURL& referrer,
1000 Profile* profile, 1001 Profile* profile,
1001 PageTransition::Type transition, 1002 PageTransition::Type transition,
1002 bool defer_load, 1003 bool defer_load,
1003 SiteInstance* instance) const { 1004 SiteInstance* instance) const {
1004 if (url == NewTabUIURL()) 1005 if (url == NewTabUIURL())
1005 return dummy_contents_; 1006 return dummy_contents_;
1006 return NULL; 1007 return NULL;
1007 } 1008 }
1008 virtual void ShowApplicationMenu(const gfx::Point& p) {} 1009 virtual void ShowApplicationMenu(const gfx::Point& p) {}
1009 virtual bool CanDuplicateContentsAt(int index) { return false; } 1010 virtual bool CanDuplicateContentsAt(int index) { return false; }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 1167
1167 // Close the Tab. The next-adjacent should be selected. 1168 // Close the Tab. The next-adjacent should be selected.
1168 strip.CloseTabContentsAt(4); 1169 strip.CloseTabContentsAt(4);
1169 1170
1170 EXPECT_EQ(3, strip.selected_index()); 1171 EXPECT_EQ(3, strip.selected_index());
1171 1172
1172 // Clean up. 1173 // Clean up.
1173 strip.CloseAllTabs(); 1174 strip.CloseAllTabs();
1174 } 1175 }
1175 1176
OLDNEW
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | chrome/browser/task_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698