OLD | NEW |
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 "chrome/browser/task_manager/task_manager_resource_providers.h" | 5 #include "chrome/browser/task_manager/task_manager_resource_providers.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 return l10n_util::GetStringFUTF16(message_id, tab_title); | 327 return l10n_util::GetStringFUTF16(message_id, tab_title); |
328 } | 328 } |
329 | 329 |
330 string16 TaskManagerTabContentsResource::GetProfileName() const { | 330 string16 TaskManagerTabContentsResource::GetProfileName() const { |
331 return GetProfileNameFromInfoCache(tab_contents_->profile()); | 331 return GetProfileNameFromInfoCache(tab_contents_->profile()); |
332 } | 332 } |
333 | 333 |
334 gfx::ImageSkia TaskManagerTabContentsResource::GetIcon() const { | 334 gfx::ImageSkia TaskManagerTabContentsResource::GetIcon() const { |
335 if (IsPrerendering()) | 335 if (IsPrerendering()) |
336 return *prerender_icon_; | 336 return *prerender_icon_; |
337 return tab_contents_->favicon_tab_helper()->GetFavicon().AsImageSkia(); | 337 const gfx::Image& icon = tab_contents_->favicon_tab_helper()->GetFavicon(); |
| 338 return icon.IsEmpty() ? gfx::ImageSkia() : *icon.ToImageSkia(); |
338 } | 339 } |
339 | 340 |
340 WebContents* TaskManagerTabContentsResource::GetWebContents() const { | 341 WebContents* TaskManagerTabContentsResource::GetWebContents() const { |
341 return tab_contents_->web_contents(); | 342 return tab_contents_->web_contents(); |
342 } | 343 } |
343 | 344 |
344 const Extension* TaskManagerTabContentsResource::GetExtension() const { | 345 const Extension* TaskManagerTabContentsResource::GetExtension() const { |
345 if (HostsExtension()) { | 346 if (HostsExtension()) { |
346 ExtensionService* extension_service = | 347 ExtensionService* extension_service = |
347 tab_contents_->profile()->GetExtensionService(); | 348 tab_contents_->profile()->GetExtensionService(); |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 | 1693 |
1693 return &resource_; | 1694 return &resource_; |
1694 } | 1695 } |
1695 | 1696 |
1696 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { | 1697 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { |
1697 task_manager_->AddResource(&resource_); | 1698 task_manager_->AddResource(&resource_); |
1698 } | 1699 } |
1699 | 1700 |
1700 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { | 1701 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { |
1701 } | 1702 } |
OLD | NEW |