Add GetAppDefaultIcon() to AppDelegate

To avoid including theme_resources.h in app_window.cc

BUG=403276

Review URL: https://codereview.chromium.org/489453002

Cr-Commit-Position: refs/heads/master@{#290769}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290769 0039d316-1c4b-4281-b951-d872f2087c98
parent dd6ea08c
......@@ -8,6 +8,7 @@
#include "content/public/common/media_stream_request.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/window_open_disposition.h"
#include "ui/gfx/image/image_skia.h"
namespace content {
class BrowserContext;
......@@ -60,6 +61,7 @@ class AppDelegate {
const content::MediaResponseCallback& callback,
const extensions::Extension* extension) = 0;
virtual int PreferredIconSize() = 0;
virtual gfx::ImageSkia GetAppDefaultIcon() = 0;
// Web contents modal dialog support.
virtual void SetWebContentsBlocked(content::WebContents* web_contents,
......
......@@ -46,9 +46,7 @@
#include "extensions/common/manifest_handlers/icons_handler.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/switches.h"
#include "grit/theme_resources.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/screen.h"
#if !defined(OS_MACOSX)
......@@ -811,10 +809,6 @@ void AppWindow::UpdateExtensionAppIcon() {
// Avoid using any previous app icons were being downloaded.
image_loader_ptr_factory_.InvalidateWeakPtrs();
const gfx::ImageSkia& default_icon =
*ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_APP_DEFAULT_ICON);
const extensions::Extension* extension = GetExtension();
if (!extension)
return;
......@@ -824,7 +818,7 @@ void AppWindow::UpdateExtensionAppIcon() {
extension,
extensions::IconsInfo::GetIcons(extension),
app_delegate_->PreferredIconSize(),
default_icon,
app_delegate_->GetAppDefaultIcon(),
this));
// Triggers actual image loading with 1x resources. The 2x resource will
......
......@@ -24,6 +24,8 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "extensions/common/constants.h"
#include "grit/theme_resources.h"
#include "ui/base/resource/resource_bundle.h"
#if defined(USE_ASH)
#include "ash/shelf/shelf_constants.h"
......@@ -234,6 +236,11 @@ int ChromeAppDelegate::PreferredIconSize() {
#endif
}
gfx::ImageSkia ChromeAppDelegate::GetAppDefaultIcon() {
return *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_APP_DEFAULT_ICON);
}
void ChromeAppDelegate::SetWebContentsBlocked(
content::WebContents* web_contents,
bool blocked) {
......
......@@ -49,6 +49,7 @@ class ChromeAppDelegate : public apps::AppDelegate {
const content::MediaResponseCallback& callback,
const extensions::Extension* extension) OVERRIDE;
virtual int PreferredIconSize() OVERRIDE;
virtual gfx::ImageSkia GetAppDefaultIcon() OVERRIDE;
virtual void SetWebContentsBlocked(content::WebContents* web_contents,
bool blocked) OVERRIDE;
virtual bool IsWebContentsVisible(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment