Chromium Code Reviews| Index: chrome/browser/android/dev_tools_discovery_provider_android.cc |
| diff --git a/chrome/browser/android/dev_tools_discovery_provider_android.cc b/chrome/browser/android/dev_tools_discovery_provider_android.cc |
| index aea64f638149379b852504353c2ca554233a81de..424c7a42a1b6571bff7ddec7c876fea0a4008744 100644 |
| --- a/chrome/browser/android/dev_tools_discovery_provider_android.cc |
| +++ b/chrome/browser/android/dev_tools_discovery_provider_android.cc |
| @@ -25,14 +25,6 @@ using content::WebContents; |
| namespace { |
| -GURL GetFaviconURLForContents(WebContents* web_contents) { |
| - content::NavigationController& controller = web_contents->GetController(); |
| - content::NavigationEntry* entry = controller.GetActiveEntry(); |
| - if (entry != NULL && entry->GetURL().is_valid()) |
| - return entry->GetFavicon().url; |
| - return GURL(); |
| -} |
| - |
| class TabDescriptor : public devtools_discovery::DevToolsTargetDescriptor { |
| public: |
| static TabDescriptor* CreateForWebContents(int tab_id, |
| @@ -138,14 +130,25 @@ class TabDescriptor : public devtools_discovery::DevToolsTargetDescriptor { |
| : tab_id_(tab_id), |
| title_(base::UTF16ToUTF8(web_contents->GetTitle())), |
| url_(web_contents->GetURL()), |
| - favicon_url_(GetFaviconURLForContents(web_contents)), |
| + favicon_url_(GetFaviconURL()), |
| last_activity_time_(web_contents->GetLastActiveTime()) { |
| } |
| TabDescriptor(int tab_id, const base::string16& title, const GURL& url) |
| : tab_id_(tab_id), |
| title_(base::UTF16ToUTF8(title)), |
| - url_(url) { |
| + url_(url), |
| + favicon_url_(GetFaviconURL()) { |
| + } |
| + |
| + GURL GetFaviconURL() { |
|
dgozman
2015/05/08 11:37:03
There is a method with the same name in this class
vkuzkokov
2015/05/12 12:16:46
Was there? It's getFaviconBitmap now.
|
| + TabModel* model; |
| + int index; |
| + if (FindTab(&model, &index)) { |
| + if (TabAndroid* tab = model->GetTabAt(index)) |
| + return tab->GetFaviconURL(); |
| + } |
| + return GURL(); |
| } |
| bool FindTab(TabModel** model_result, int* index_result) const { |