Index: chrome/browser/extensions/extension_tab_util.cc |
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc |
index f1ef9c051915e1d24062eb971a72d40fa3165e1e..f6774e7c06ca3c3c567324115f173e7699bae5b0 100644 |
--- a/chrome/browser/extensions/extension_tab_util.cc |
+++ b/chrome/browser/extensions/extension_tab_util.cc |
@@ -333,7 +333,8 @@ std::unique_ptr<api::tabs::Tab> ExtensionTabUtil::CreateTabObject( |
WebContents* contents, |
TabStripModel* tab_strip, |
int tab_index, |
- const Extension* extension) { |
+ const Extension* extension, |
+ UrlType url_type) { |
// If we have a matching AppWindow with a controller, get the tab value |
// from its controller instead. |
WindowController* controller = GetAppWindowController(contents); |
@@ -342,7 +343,7 @@ std::unique_ptr<api::tabs::Tab> ExtensionTabUtil::CreateTabObject( |
return controller->CreateTabObject(extension, tab_index); |
} |
std::unique_ptr<api::tabs::Tab> result = |
- CreateTabObject(contents, tab_strip, tab_index); |
+ CreateTabObject(contents, tab_strip, tab_index, url_type); |
ScrubTabForExtension(extension, contents, result.get()); |
return result; |
} |
@@ -365,7 +366,8 @@ std::unique_ptr<base::ListValue> ExtensionTabUtil::CreateTabList( |
std::unique_ptr<api::tabs::Tab> ExtensionTabUtil::CreateTabObject( |
content::WebContents* contents, |
TabStripModel* tab_strip, |
- int tab_index) { |
+ int tab_index, |
+ UrlType url_type) { |
// If we have a matching AppWindow with a controller, get the tab value |
// from its controller instead. |
WindowController* controller = GetAppWindowController(contents); |
@@ -396,7 +398,14 @@ std::unique_ptr<api::tabs::Tab> ExtensionTabUtil::CreateTabObject( |
tab_object->height.reset( |
new int(contents->GetContainerBounds().size().height())); |
- tab_object->url.reset(new std::string(contents->GetURL().spec())); |
+ GURL url; |
+ switch (url_type) { |
+ case LastCommitted: |
+ url = contents->GetLastCommittedURL(); |
+ case Visible: |
+ url = contents->GetVisibleURL(); |
+ } |
+ tab_object->url.reset(new std::string(url.spec())); |
tab_object->title.reset( |
new std::string(base::UTF16ToUTF8(contents->GetTitle()))); |
NavigationEntry* entry = contents->GetController().GetVisibleEntry(); |