Index: chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler2.h |
diff --git a/chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler2.h b/chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler2.h |
index da162ed4f3b9abe82f0c8f60c9fdd221b61e6526..62657999a3bc85a185fcca5168a533ab69bb1841 100644 |
--- a/chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler2.h |
+++ b/chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler2.h |
@@ -5,8 +5,11 @@ |
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_SET_WALLPAPER_OPTIONS_HANDLER2_H_ |
#define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_SET_WALLPAPER_OPTIONS_HANDLER2_H_ |
+#include "ash/desktop_background/desktop_background_resources.h" |
#include "base/memory/weak_ptr.h" |
+#include "chrome/browser/ui/select_file_dialog.h" |
#include "chrome/browser/ui/webui/options2/options_ui2.h" |
+#include "content/public/browser/notification_registrar.h" |
#include "ui/gfx/native_widget_types.h" |
namespace base { |
@@ -18,7 +21,8 @@ namespace chromeos { |
namespace options2 { |
// ChromeOS user image options page UI handler. |
-class SetWallpaperOptionsHandler : public ::options2::OptionsPageUIHandler{ |
+class SetWallpaperOptionsHandler : public ::options2::OptionsPageUIHandler, |
+ public SelectFileDialog::Listener { |
public: |
SetWallpaperOptionsHandler(); |
virtual ~SetWallpaperOptionsHandler(); |
@@ -34,21 +38,51 @@ class SetWallpaperOptionsHandler : public ::options2::OptionsPageUIHandler{ |
// Sends list of available default images to the page. |
void SendDefaultImages(); |
+ // Sends layout options for custom wallpaper. Only exposed CENTER, |
James Hawkins
2012/05/09 18:21:25
s/exposed/exposes/
bshe
2012/05/09 20:37:15
Done.
|
+ // CENTER_CROPPED, STRETCH to users. Set the selected option to specified |
+ // |layout|. |
+ void SendLayoutOptions(ash::WallpaperLayout layout); |
+ |
// Handles page initialized event. |
void HandlePageInitialized(const base::ListValue* args); |
// Handles page shown event. |
void HandlePageShown(const base::ListValue* args); |
+ // Opens a file selection dialog to choose user image from file. |
+ void HandleChooseFile(const base::ListValue* args); |
+ |
+ // SelectFileDialog::Delegate implementation. |
James Hawkins
2012/05/09 18:21:25
Interface implementations need to be grouped toget
bshe
2012/05/09 20:37:15
Done.
|
+ virtual void FileSelected( |
+ const FilePath& path, |
+ int index, void* params) OVERRIDE; |
+ |
+ // Redraw the wallpaper with specified wallpaper layout. |
+ void HandleLayoutChanged(const base::ListValue* args); |
+ |
// Selects one of the available default wallpapers. |
void HandleDefaultWallpaper(const base::ListValue* args); |
// Sets user wallpaper to a random one from the default wallpapers. |
void HandleRandomWallpaper(const base::ListValue* args); |
+ // Call javascript function to add/update custom wallpaper thumbnail in |
+ // picker UI. |
+ void SetCustomWallpaperThumbnail(); |
+ |
+ // content::NotificationObserver implementation. |
+ virtual void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) OVERRIDE; |
+ |
// Returns handle to browser window or NULL if it can't be found. |
gfx::NativeWindow GetBrowserWindow() const; |
+ // Shows a dialog box for selecting a file. |
+ scoped_refptr<SelectFileDialog> select_file_dialog_; |
+ |
+ content::NotificationRegistrar registrar_; |
+ |
base::WeakPtrFactory<SetWallpaperOptionsHandler> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(SetWallpaperOptionsHandler); |