| Index: chrome/browser/ui/browser.cc
|
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
| index 8e8f55f7bc6d9d234a4f975732ef926a21f7082e..8ab93c0fd22a0db3c20078fe49c3d28898187142 100644
|
| --- a/chrome/browser/ui/browser.cc
|
| +++ b/chrome/browser/ui/browser.cc
|
| @@ -3051,9 +3051,9 @@ void Browser::ShowPageInfo(Profile* profile,
|
| window()->ShowPageInfo(profile, url, ssl, show_history);
|
| }
|
|
|
| -void Browser::ViewSourceForTab(TabContents* contents) {
|
| - DCHECK(contents);
|
| - int index = tabstrip_model()->GetWrapperIndex(contents);
|
| +void Browser::ViewSourceForTab(TabContents* source, const GURL& page_url) {
|
| + DCHECK(source);
|
| + int index = tabstrip_model()->GetWrapperIndex(source);
|
| TabContentsWrapper* wrapper = tabstrip_model()->GetTabContentsAt(index);
|
| ViewSource(wrapper);
|
| }
|
| @@ -4133,6 +4133,9 @@ void Browser::ViewSource(TabContentsWrapper* contents) {
|
| view_source_contents->controller().PruneAllButActive();
|
| NavigationEntry* active_entry =
|
| view_source_contents->controller().GetActiveEntry();
|
| + if (!active_entry)
|
| + return;
|
| +
|
| GURL url = GURL(chrome::kViewSourceScheme + std::string(":") +
|
| active_entry->url().spec());
|
| active_entry->set_virtual_url(url);
|
|
|