diff options
author | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-28 22:23:48 +0000 |
---|---|---|
committer | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-28 22:23:48 +0000 |
commit | a7668a1bbb5f73d631f24c2dac7ae16ab7a43433 (patch) | |
tree | c42ecb58dc4d77f500d7e88863692deae4f69292 | |
parent | 32b82b8811610227d2edd4d70ca453f54755fe77 (diff) | |
download | chromium_src-a7668a1bbb5f73d631f24c2dac7ae16ab7a43433.zip chromium_src-a7668a1bbb5f73d631f24c2dac7ae16ab7a43433.tar.gz chromium_src-a7668a1bbb5f73d631f24c2dac7ae16ab7a43433.tar.bz2 |
Initial landing of experimental wallpaper ui(wallpaper manager).
This experimental wallpaper is disabled by default. To enable it, go to about:flags
and enable "experimental wallpaper UI" or add --experimental-wallpaper-ui to the
command line.
It currently designed as an extension which overrides url chrome://wallpapers. It's
basically the same as file manager and bookmark manager which overrides chrome://files
and chrome://bookmarks.
This is just a place holder for now.
BUG=118684
TEST=
Review URL: https://chromiumcodereview.appspot.com/10391116
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139265 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 7 | ||||
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 2 | ||||
-rw-r--r-- | chrome/browser/browser_resources.grd | 3 | ||||
-rw-r--r-- | chrome/browser/extensions/component_loader.cc | 8 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_protocols.cc | 11 | ||||
-rw-r--r-- | chrome/browser/resources/chromeos/wallpaper_manager/main.html | 17 | ||||
-rw-r--r-- | chrome/browser/resources/chromeos/wallpaper_manager/manifest.json | 10 | ||||
-rw-r--r-- | chrome/browser/resources/component_extension_resources.grd | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/common/extensions/extension.cc | 2 | ||||
-rw-r--r-- | chrome/common/url_constants.cc | 2 | ||||
-rw-r--r-- | chrome/common/url_constants.h | 2 |
14 files changed, 74 insertions, 3 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 6945e95..0990a3d 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -5683,6 +5683,12 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_FLAGS_ENABLE_APPLIST_V2_DESCRIPTION" desc="Description of the flag to enable applist v2 in ash."> Enables the bubble-style applist v2. </message> + <message name="IDS_FLAGS_EXPERIMENTAL_WALLPAPER_UI_NAME" desc="Name of the flag to enable experimental wallpaper picker ui in chromeos."> + Experimental Wallpaper UI. + </message> + <message name="IDS_FLAGS_EXPERIMENTAL_WALLPAPER_UI_DESCRIPTION" desc="Description of the flag to enabel experimental wallpaper picker ui in chromeos."> + Enables the experimental wallpaper UI. + </message> <message name="IDS_FLAGS_ENABLE_ASH_NOTIFY_NAME" desc="Name of the flag to enable applist v2 in ash."> Enable Ash notifications. </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 5fdcde9..9eee218 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -748,6 +748,13 @@ const Experiment kExperiments[] = { #endif // defined(USE_ASH) #if defined(OS_CHROMEOS) { + "experimental-wallpaper-ui", + IDS_FLAGS_EXPERIMENTAL_WALLPAPER_UI_NAME, + IDS_FLAGS_EXPERIMENTAL_WALLPAPER_UI_DESCRIPTION, + kOsCrOS, + SINGLE_VALUE_TYPE(switches::kExperimentalWallpaperUI) + }, + { "enable-new-oobe", IDS_FLAGS_ENABLE_NEW_OOBE, IDS_FLAGS_ENABLE_NEW_OOBE_DESCRIPTION, diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index ac2fcea..ecb8f2c 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -76,6 +76,7 @@ const char* const kChromePaths[] = { chrome::kChromeUIOSCreditsHost, chrome::kChromeUIProxySettingsHost, chrome::kChromeUISystemInfoHost, + chrome::kChromeUIWallpaperHost, #endif }; @@ -164,4 +165,3 @@ std::vector<std::string> ChromePaths() { paths.push_back(kChromePaths[i]); return paths; } - diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index bb61919..8b8165a 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd @@ -181,6 +181,9 @@ <if expr="pp_ifdef('file_manager_extension')"> <include name="IDR_FILEMANAGER_MANIFEST" file="resources\file_manager\manifest.json" type="BINDATA" /> </if> + <if expr="pp_ifdef('chromeos')"> + <include name="IDR_WALLPAPERMANAGER_MANIFEST" file="resources\chromeos\wallpaper_manager\manifest.json" type="BINDATA" /> + </if> <if expr="(is_linux and pp_ifdef('toolkit_views')) or pp_ifdef('use_aura')"> <include name="IDR_HTTP_AUTH_HTML" file="resources\http_auth.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_TAB_MODAL_CONFIRM_DIALOG_HTML" file="resources\tab_modal_confirm_dialog.html" flattenhtml="true" type="BINDATA" /> diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc index b4c14db..9a02b63 100644 --- a/chrome/browser/extensions/component_loader.cc +++ b/chrome/browser/extensions/component_loader.cc @@ -287,6 +287,14 @@ void ComponentLoader::AddDefaultComponentExtensions() { Add(IDR_BOOKMARKS_MANIFEST, FilePath(FILE_PATH_LITERAL("bookmark_manager"))); #endif +#if defined(OS_CHROMEOS) + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kExperimentalWallpaperUI)) { + Add(IDR_WALLPAPERMANAGER_MANIFEST, + FilePath(FILE_PATH_LITERAL("chromeos/wallpaper_manager"))); + } +#endif + #if defined(FILE_MANAGER_EXTENSION) AddFileManagerExtension(); #endif diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc index 8875e1e..e42c4c7 100644 --- a/chrome/browser/extensions/extension_protocols.cc +++ b/chrome/browser/extensions/extension_protocols.cc @@ -293,9 +293,16 @@ ExtensionProtocolHandler::MaybeCreateJob(net::URLRequest* request) const { } FilePath resources_path; + FilePath relative_path; + // Try to load extension resources from chrome resource file if + // directory_path is a descendant of resources_path. resources_path + // corresponds to src/chrome/browser/resources in source tree. if (PathService::Get(chrome::DIR_RESOURCES, &resources_path) && - directory_path.DirName() == resources_path) { - FilePath relative_path = directory_path.BaseName().Append( + // Since component extension resources are included in + // component_extension_resources.pak file in resources_path, calculate + // extension relative path against resources_path. + resources_path.AppendRelativePath(directory_path, &relative_path)) { + relative_path = relative_path.Append( extension_file_util::ExtensionURLToRelativeFilePath(request->url())); relative_path = relative_path.NormalizePathSeparators(); diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/main.html b/chrome/browser/resources/chromeos/wallpaper_manager/main.html new file mode 100644 index 0000000..7085247 --- /dev/null +++ b/chrome/browser/resources/chromeos/wallpaper_manager/main.html @@ -0,0 +1,17 @@ +<!DOCTYPE HTML> +<html i18n-values="dir:textdirection;"> +<!-- +------ +Copyright (c) 2012 The Chromium Authors. All rights reserved. +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. + +--> +<head> + <title>Placeholder for Wallpaper Manager Main page</title> +</head> +<body> + <h1>Wallpaper Manager</h1> + <p>Coming soon.</p> +</body> +</html> diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/manifest.json b/chrome/browser/resources/chromeos/wallpaper_manager/manifest.json new file mode 100644 index 0000000..d71d2f1 --- /dev/null +++ b/chrome/browser/resources/chromeos/wallpaper_manager/manifest.json @@ -0,0 +1,10 @@ +{ + // chrome-extension://obklkkbkpaoaejdabbfldmcfplpdgolj/ + "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6czTauf4/ISarT2JOcjcanIq+kcL/2UOF56QqXNT6PFgEwBG1i9Tfw/dTE59qWdGuxWt4yQlChewOFaRP3nb9AygPFXO31pNXaCY9xyDsjE5RhVvVB0GJa3VHFITIROpBSJHXNOqZBm706A8SFCTauasdWPFSE6Y7sA13t1P0MwIDAQAB", + "name": "Wallpaper Picker", + "version": "0.1", + "description": "An experimental wallpaper picker UI", + "chrome_url_overrides": { + "wallpapers": "main.html" + } +} diff --git a/chrome/browser/resources/component_extension_resources.grd b/chrome/browser/resources/component_extension_resources.grd index 9189ba3..d42bd4f 100644 --- a/chrome/browser/resources/component_extension_resources.grd +++ b/chrome/browser/resources/component_extension_resources.grd @@ -222,6 +222,9 @@ <include name="IDR_FILE_MANAGER_MEDIA_ERROR" file="file_manager/images/media/error.png" type="BINDATA" /> </if> + <if expr="pp_ifdef('chromeos')"> + <include name="IDR_WALLPAPER_MANAGER_MAIN" file="chromeos/wallpaper_manager/main.html" flattenhtml="true" type="BINDATA" /> + </if> </includes> </release> </grit> diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 66c0b51..bd0f027 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -1293,6 +1293,9 @@ const char kEnableONCPolicy[] = "enable-onc-policy"; // default. const char kEnableStaticIPConfig[] = "enable-static-ip-config"; +// Enables the experimental wallpaper picker UI. +const char kExperimentalWallpaperUI[] = "experimental-wallpaper-ui"; + // Path for the screensaver used in Kiosk mode const char kKioskModeScreensaverPath[] = "kiosk-mode-screensaver-path"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 6d9dbfd..29af8db 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -353,6 +353,7 @@ extern const char kEnableKioskMode[]; extern const char kEnableMobileSetupDialog[]; extern const char kEnableONCPolicy[]; extern const char kEnableStaticIPConfig[]; +extern const char kExperimentalWallpaperUI[]; extern const char kKioskModeScreensaverPath[]; extern const char kLoginManager[]; // TODO(avayvod): Remove this flag when it's unnecessary for testing diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index c481193..7960b6c 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -2325,6 +2325,7 @@ bool Extension::LoadChromeURLOverrides(string16* error) { if ((page != chrome::kChromeUINewTabHost && #if defined(OS_CHROMEOS) page != chrome::kChromeUIActivationMessageHost && + page != chrome::kChromeUIWallpaperHost && #endif page != chrome::kChromeUIBookmarksHost && page != chrome::kChromeUIHistoryHost @@ -2340,6 +2341,7 @@ bool Extension::LoadChromeURLOverrides(string16* error) { } // Replace the entry with a fully qualified chrome-extension:// URL. chrome_url_overrides_[page] = GetResourceURL(val); + // For component extensions, add override URL to extent patterns. if (is_packaged_app() && location() == COMPONENT) { URLPattern pattern(URLPattern::SCHEME_CHROMEUI); diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index b00a417..2204ea9 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -94,6 +94,7 @@ const char kChromeUISlideshowURL[] = "chrome://slideshow/"; const char kChromeUISystemInfoURL[] = "chrome://system/"; const char kChromeUITermsOemURL[] = "chrome://terms/oem"; const char kChromeUIUserImageURL[] = "chrome://userimage/"; +const char kChromeUIWallpaperURL[] = "chrome://wallpapers/"; const char kChromeUIWallpaperThumbnailURL[] = "chrome://wallpaper/"; #endif @@ -221,6 +222,7 @@ const char kChromeUISimUnlockHost[] = "sim-unlock"; const char kChromeUISlideshowHost[] = "slideshow"; const char kChromeUISystemInfoHost[] = "system"; const char kChromeUIUserImageHost[] = "userimage"; +const char kChromeUIWallpaperHost[] = "wallpapers"; const char kChromeUIWallpaperThumbnailHost[] = "wallpaper"; const char kChromeUIMenu[] = "menu"; diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h index d97ce50..31f6042 100644 --- a/chrome/common/url_constants.h +++ b/chrome/common/url_constants.h @@ -88,6 +88,7 @@ extern const char kChromeUISlideshowURL[]; extern const char kChromeUISystemInfoURL[]; extern const char kChromeUITermsOemURL[]; extern const char kChromeUIUserImageURL[]; +extern const char kChromeUIWallpaperURL[]; extern const char kChromeUIWallpaperThumbnailURL[]; #endif @@ -213,6 +214,7 @@ extern const char kChromeUISimUnlockHost[]; extern const char kChromeUISlideshowHost[]; extern const char kChromeUISystemInfoHost[]; extern const char kChromeUIUserImageHost[]; +extern const char kChromeUIWallpaperHost[]; extern const char kChromeUIWallpaperThumbnailHost[]; extern const char kChromeUIMenu[]; |