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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_SET_WALLPAPER_OPTIONS_HANDLER_
H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_SET_WALLPAPER_OPTIONS_HANDLER_
H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_SET_WALLPAPER_OPTIONS_HANDLER_
H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_SET_WALLPAPER_OPTIONS_HANDLER_
H_ |
7 | 7 |
8 #include "ash/desktop_background/desktop_background_resources.h" | 8 #include "ash/desktop_background/desktop_background_resources.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/ui/select_file_dialog.h" | |
11 #include "chrome/browser/ui/webui/options2/options_ui.h" | 10 #include "chrome/browser/ui/webui/options2/options_ui.h" |
| 11 #include "ui/base/dialogs/select_file_dialog.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class DictionaryValue; | 15 class DictionaryValue; |
16 class ListValue; | 16 class ListValue; |
17 } | 17 } |
18 | 18 |
19 namespace chromeos { | 19 namespace chromeos { |
20 | 20 |
21 class WallpaperDelegate { | 21 class WallpaperDelegate { |
22 public: | 22 public: |
23 // Call javascript function to add/update custom wallpaper thumbnail in | 23 // Call javascript function to add/update custom wallpaper thumbnail in |
24 // picker UI. | 24 // picker UI. |
25 virtual void SetCustomWallpaperThumbnail() = 0; | 25 virtual void SetCustomWallpaperThumbnail() = 0; |
26 | 26 |
27 protected: | 27 protected: |
28 virtual ~WallpaperDelegate() {} | 28 virtual ~WallpaperDelegate() {} |
29 }; | 29 }; |
30 | 30 |
31 namespace options2 { | 31 namespace options2 { |
32 | 32 |
33 // ChromeOS user image options page UI handler. | 33 // ChromeOS user image options page UI handler. |
34 class SetWallpaperOptionsHandler : public ::options2::OptionsPageUIHandler, | 34 class SetWallpaperOptionsHandler : public ::options2::OptionsPageUIHandler, |
35 public SelectFileDialog::Listener, | 35 public ui::SelectFileDialog::Listener, |
36 public WallpaperDelegate { | 36 public WallpaperDelegate { |
37 public: | 37 public: |
38 SetWallpaperOptionsHandler(); | 38 SetWallpaperOptionsHandler(); |
39 virtual ~SetWallpaperOptionsHandler(); | 39 virtual ~SetWallpaperOptionsHandler(); |
40 | 40 |
41 // OptionsPageUIHandler implementation. | 41 // OptionsPageUIHandler implementation. |
42 virtual void GetLocalizedValues( | 42 virtual void GetLocalizedValues( |
43 base::DictionaryValue* localized_strings) OVERRIDE; | 43 base::DictionaryValue* localized_strings) OVERRIDE; |
44 | 44 |
45 // WebUIMessageHandler implementation. | 45 // WebUIMessageHandler implementation. |
(...skipping 30 matching lines...) Expand all Loading... |
76 // Selects one of the available default wallpapers. | 76 // Selects one of the available default wallpapers. |
77 void HandleDefaultWallpaper(const base::ListValue* args); | 77 void HandleDefaultWallpaper(const base::ListValue* args); |
78 | 78 |
79 // Sets user wallpaper to the next one in the list of default wallpapers. | 79 // Sets user wallpaper to the next one in the list of default wallpapers. |
80 void HandleDailyWallpaper(const base::ListValue* args); | 80 void HandleDailyWallpaper(const base::ListValue* args); |
81 | 81 |
82 // Returns handle to browser window or NULL if it can't be found. | 82 // Returns handle to browser window or NULL if it can't be found. |
83 gfx::NativeWindow GetBrowserWindow() const; | 83 gfx::NativeWindow GetBrowserWindow() const; |
84 | 84 |
85 // Shows a dialog box for selecting a file. | 85 // Shows a dialog box for selecting a file. |
86 scoped_refptr<SelectFileDialog> select_file_dialog_; | 86 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
87 | 87 |
88 base::WeakPtrFactory<SetWallpaperOptionsHandler> weak_factory_; | 88 base::WeakPtrFactory<SetWallpaperOptionsHandler> weak_factory_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(SetWallpaperOptionsHandler); | 90 DISALLOW_COPY_AND_ASSIGN(SetWallpaperOptionsHandler); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace options2 | 93 } // namespace options2 |
94 } // namespace chromeos | 94 } // namespace chromeos |
95 | 95 |
96 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_SET_WALLPAPER_OPTIONS_HANDL
ER_H_ | 96 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_SET_WALLPAPER_OPTIONS_HANDL
ER_H_ |
OLD | NEW |