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

Side by Side Diff: chrome/browser/extensions/extension_url_rewrite_browsertest.cc

Issue 10535077: TabContentsWrapper -> TabContents, part 12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/process_util.h" 5 #include "base/process_util.h"
6 #include "base/sys_string_conversions.h" 6 #include "base/sys_string_conversions.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/extension_browsertest.h" 8 #include "chrome/browser/extensions/extension_browsertest.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 15 matching lines...) Expand all
26 std::string GetLocationBarText() const { 26 std::string GetLocationBarText() const {
27 return UTF16ToUTF8( 27 return UTF16ToUTF8(
28 browser()->window()->GetLocationBar()->GetLocationEntry()->GetText()); 28 browser()->window()->GetLocationBar()->GetLocationEntry()->GetText());
29 } 29 }
30 30
31 GURL GetLocationBarTextAsURL() const { 31 GURL GetLocationBarTextAsURL() const {
32 return GURL(GetLocationBarText()); 32 return GURL(GetLocationBarText());
33 } 33 }
34 34
35 content::NavigationController* GetNavigationController() const { 35 content::NavigationController* GetNavigationController() const {
36 return &browser()->GetSelectedWebContents()->GetController(); 36 return &browser()->GetActiveWebContents()->GetController();
37 } 37 }
38 38
39 NavigationEntry* GetNavigationEntry() const { 39 NavigationEntry* GetNavigationEntry() const {
40 return GetNavigationController()->GetActiveEntry(); 40 return GetNavigationController()->GetActiveEntry();
41 } 41 }
42 42
43 FilePath GetTestExtensionPath(const char* extension_name) const { 43 FilePath GetTestExtensionPath(const char* extension_name) const {
44 return test_data_dir_.AppendASCII("browsertest/url_rewrite/"). 44 return test_data_dir_.AppendASCII("browsertest/url_rewrite/").
45 AppendASCII(extension_name); 45 AppendASCII(extension_name);
46 } 46 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 TestExtensionURLOverride(url_with_ref); 103 TestExtensionURLOverride(url_with_ref);
104 } 104 }
105 105
106 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, BookmarksURLOverride) { 106 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, BookmarksURLOverride) {
107 // Load an extension that overrides chrome://bookmarks. 107 // Load an extension that overrides chrome://bookmarks.
108 LoadExtension(GetTestExtensionPath("bookmarks")); 108 LoadExtension(GetTestExtensionPath("bookmarks"));
109 // Navigate to chrome://bookmarks and check that the location bar URL is what 109 // Navigate to chrome://bookmarks and check that the location bar URL is what
110 // was entered and the internal URL uses the chrome-extension:// scheme. 110 // was entered and the internal URL uses the chrome-extension:// scheme.
111 TestExtensionURLOverride(GURL(chrome::kChromeUIBookmarksURL)); 111 TestExtensionURLOverride(GURL(chrome::kChromeUIBookmarksURL));
112 } 112 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.cc ('k') | chrome/browser/extensions/extension_web_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698