Chromium Code Reviews| Index: chrome/browser/extensions/extension_tab_util.cc |
| =================================================================== |
| --- chrome/browser/extensions/extension_tab_util.cc (revision 142698) |
| +++ chrome/browser/extensions/extension_tab_util.cc (working copy) |
| @@ -81,13 +81,19 @@ |
| DictionaryValue* ExtensionTabUtil::CreateTabValue(const WebContents* contents, |
| TabStripModel* tab_strip, |
| int tab_index) { |
| + return ExtensionTabUtil::CreateTabValue(contents, tab_strip, tab_index, true); |
| +} |
| + |
| +DictionaryValue* ExtensionTabUtil::CreateTabValue(const WebContents* contents, |
| + TabStripModel* tab_strip, |
| + int tab_index, |
| + bool hasPermission) { |
|
Aaron Boodman
2012/07/16 21:37:59
You're going to change this because of other comme
SanjoyPal
2012/07/17 10:39:56
Done.
|
| DictionaryValue* result = new DictionaryValue(); |
| bool is_loading = contents->IsLoading(); |
| result->SetInteger(keys::kIdKey, ExtensionTabUtil::GetTabId(contents)); |
| result->SetInteger(keys::kIndexKey, tab_index); |
| result->SetInteger(keys::kWindowIdKey, |
| ExtensionTabUtil::GetWindowIdOfTab(contents)); |
| - result->SetString(keys::kUrlKey, contents->GetURL().spec()); |
| result->SetString(keys::kStatusKey, GetTabStatusText(is_loading)); |
| result->SetBoolean(keys::kActiveKey, |
| tab_strip && tab_index == tab_strip->active_index()); |
| @@ -97,7 +103,6 @@ |
| tab_strip && tab_strip->IsTabSelected(tab_index)); |
| result->SetBoolean(keys::kPinnedKey, |
| tab_strip && tab_strip->IsTabPinned(tab_index)); |
| - result->SetString(keys::kTitleKey, contents->GetTitle()); |
| result->SetBoolean(keys::kIncognitoKey, |
| contents->GetBrowserContext()->IsOffTheRecord()); |
| @@ -109,12 +114,16 @@ |
| ExtensionTabUtil::GetTabId(opener->GetWebContents())); |
| } |
| } |
| - |
| - if (!is_loading) { |
| - NavigationEntry* entry = contents->GetController().GetActiveEntry(); |
| - if (entry) { |
| - if (entry->GetFavicon().valid) |
| - result->SetString(keys::kFaviconUrlKey, entry->GetFavicon().url.spec()); |
| + if (hasPermission) { |
| + result->SetString(keys::kUrlKey, contents->GetURL().spec()); |
| + result->SetString(keys::kTitleKey, contents->GetTitle()); |
| + if (!is_loading) { |
| + NavigationEntry* entry = contents->GetController().GetActiveEntry(); |
| + if (entry) { |
| + if (entry->GetFavicon().valid) |
| + result->SetString(keys::kFaviconUrlKey, |
| + entry->GetFavicon().url.spec()); |
| + } |
| } |
| } |