Commit d86550c0 authored by sadrul@chromium.org's avatar sadrul@chromium.org

athena: Bundle a static background image with athena.

BUG=none
R=oshima@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287904 0039d316-1c4b-4281-b951-d872f2087c98
parent c1ee9705
...@@ -125,6 +125,7 @@ ...@@ -125,6 +125,7 @@
'../ui/wm/wm.gyp:wm', '../ui/wm/wm.gyp:wm',
'../url/url.gyp:url_lib', '../url/url.gyp:url_lib',
'athena_lib', 'athena_lib',
'resources/athena_resources.gyp:athena_resources',
], ],
'sources': [ 'sources': [
'main/athena_launcher.cc', 'main/athena_launcher.cc',
......
...@@ -12,6 +12,7 @@ include_rules = [ ...@@ -12,6 +12,7 @@ include_rules = [
"+components/metrics/proto", "+components/metrics/proto",
"+components/search_engines", "+components/search_engines",
"+content/public", "+content/public",
"+grit",
"+net", "+net",
"+ui/aura", "+ui/aura",
"+ui/app_list", "+ui/app_list",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
'../athena.gyp:athena_lib', '../athena.gyp:athena_lib',
'../athena.gyp:athena_content_lib', '../athena.gyp:athena_content_lib',
'../resources/athena_resources.gyp:athena_pak', '../resources/athena_resources.gyp:athena_pak',
'../resources/athena_resources.gyp:athena_resources',
# debug_widow.cc depends on this. Remove this once debug_window # debug_widow.cc depends on this. Remove this once debug_window
# is removed. # is removed.
'../../ash/ash_resources.gyp:ash_resources', '../../ash/ash_resources.gyp:ash_resources',
......
...@@ -7,11 +7,9 @@ ...@@ -7,11 +7,9 @@
#include "athena/activity/public/activity_factory.h" #include "athena/activity/public/activity_factory.h"
#include "athena/activity/public/activity_manager.h" #include "athena/activity/public/activity_manager.h"
#include "athena/screen/public/screen_manager.h" #include "athena/screen/public/screen_manager.h"
#include "base/memory/scoped_ptr.h" #include "grit/athena_resources.h"
#include "third_party/skia/include/core/SkColor.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "ui/views/painter.h"
void CreateTestPages(content::BrowserContext* browser_context) { void CreateTestPages(content::BrowserContext* browser_context) {
const char* kTestURLs[] = { const char* kTestURLs[] = {
...@@ -26,11 +24,7 @@ void CreateTestPages(content::BrowserContext* browser_context) { ...@@ -26,11 +24,7 @@ void CreateTestPages(content::BrowserContext* browser_context) {
} }
void SetupBackgroundImage() { void SetupBackgroundImage() {
gfx::Size size(200, 200); const gfx::ImageSkia wallpaper = *ui::ResourceBundle::GetSharedInstance()
gfx::Canvas canvas(size, 1.0f, true); .GetImageSkiaNamed(IDR_ATHENA_BACKGROUND);
scoped_ptr<views::Painter> painter( athena::ScreenManager::Get()->SetBackgroundImage(wallpaper);
views::Painter::CreateVerticalGradient(SK_ColorBLUE, SK_ColorCYAN));
painter->Paint(&canvas, size);
athena::ScreenManager::Get()->SetBackgroundImage(
gfx::ImageSkia(canvas.ExtractImageRep()));
} }
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1">
<outputs>
<output filename="grit/athena_resources.h" type="rc_header" context="default_100_percent">
<emit emit_type='prepend'></emit>
</output>
<output filename="athena_resources_100_percent.pak" type="data_package" context="default_100_percent" />
<output filename="athena_resources_200_percent.pak" type="data_package" context="default_200_percent" />
</outputs>
<release seq="1">
<structures fallback_to_low_resolution="true">
<!-- KEEP THESE IN ALPHABETICAL ORDER! -->
<structure type="chrome_scaled_image" name="IDR_ATHENA_BACKGROUND" file="background_wallpaper.png" />
</structures>
</release>
</grit>
...@@ -7,6 +7,23 @@ ...@@ -7,6 +7,23 @@
'chromium_code': 1, 'chromium_code': 1,
}, },
'targets': [ 'targets': [
{
'target_name': 'athena_resources',
'type': 'none',
'variables': {
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/athena/resources',
},
'actions': [
{
'action_name': 'athena_resources',
'variables': {
'grit_grd_file': 'athena_resources.grd',
},
'includes': [ '../../build/grit_action.gypi' ],
},
],
'includes': [ '../../build/grit_target.gypi' ],
},
{ {
'target_name': 'athena_pak', 'target_name': 'athena_pak',
'type': 'none', 'type': 'none',
...@@ -17,6 +34,7 @@ ...@@ -17,6 +34,7 @@
'../../ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings', '../../ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings',
'../../webkit/webkit_resources.gyp:webkit_resources', '../../webkit/webkit_resources.gyp:webkit_resources',
'../../webkit/webkit_resources.gyp:webkit_strings', '../../webkit/webkit_resources.gyp:webkit_strings',
'athena_resources',
], ],
'actions': [{ 'actions': [{
'action_name': 'repack_athena_pack', 'action_name': 'repack_athena_pack',
...@@ -24,6 +42,7 @@ ...@@ -24,6 +42,7 @@
'pak_inputs': [ 'pak_inputs': [
'<(PRODUCT_DIR)/extensions_shell_and_test.pak', '<(PRODUCT_DIR)/extensions_shell_and_test.pak',
'<(SHARED_INTERMEDIATE_DIR)/ash/resources/ash_resources_100_percent.pak', '<(SHARED_INTERMEDIATE_DIR)/ash/resources/ash_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/athena/resources/athena_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/chromeos/resources/ui_chromeos_resources_100_percent.pak', '<(SHARED_INTERMEDIATE_DIR)/ui/chromeos/resources/ui_chromeos_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/chromeos/strings/ui_chromeos_strings_en-US.pak', '<(SHARED_INTERMEDIATE_DIR)/ui/chromeos/strings/ui_chromeos_strings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
......
...@@ -54,6 +54,9 @@ ...@@ -54,6 +54,9 @@
"includes": [6100], "includes": [6100],
"structures": [6150], "structures": [6150],
}, },
"athena/resources/athena_resources.grd": {
"structures": [6400],
},
"chrome/app/theme/theme_resources.grd": { "chrome/app/theme/theme_resources.grd": {
"structures": [6500], "structures": [6500],
}, },
......
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