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_OPTIONS_MEDIA_GALLERIES_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MEDIA_GALLERIES_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MEDIA_GALLERIES_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MEDIA_GALLERIES_HANDLER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" |
9 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
10 #include "chrome/browser/ui/webui/options/options_ui.h" | 11 #include "chrome/browser/ui/webui/options/options_ui.h" |
11 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
12 #include "ui/shell_dialogs/select_file_dialog.h" | 13 #include "ui/shell_dialogs/select_file_dialog.h" |
13 | 14 |
14 namespace options { | 15 namespace options { |
15 | 16 |
16 // Handles messages related to adding or removing media galleries. | 17 // Handles messages related to adding or removing media galleries. |
17 class MediaGalleriesHandler : public OptionsPageUIHandler, | 18 class MediaGalleriesHandler : public OptionsPageUIHandler, |
18 public ui::SelectFileDialog::Listener { | 19 public ui::SelectFileDialog::Listener { |
(...skipping 14 matching lines...) Expand all Loading... |
33 private: | 34 private: |
34 // Handles the "addNewGallery" message (no arguments). | 35 // Handles the "addNewGallery" message (no arguments). |
35 void HandleAddNewGallery(const base::ListValue* args); | 36 void HandleAddNewGallery(const base::ListValue* args); |
36 // Handles "forgetGallery" message. The first and only argument is the id of | 37 // Handles "forgetGallery" message. The first and only argument is the id of |
37 // the gallery. | 38 // the gallery. |
38 void HandleForgetGallery(const base::ListValue* args); | 39 void HandleForgetGallery(const base::ListValue* args); |
39 | 40 |
40 // Called when the list of known galleries has changed; updates the page. | 41 // Called when the list of known galleries has changed; updates the page. |
41 void OnGalleriesChanged(); | 42 void OnGalleriesChanged(); |
42 | 43 |
| 44 // Bottom half of |InitializePage()| after async call to initialize |
| 45 // StorageMonitor. |
| 46 void InitializeOnStorageMonitorInit(); |
| 47 |
| 48 // Bottom half of |RegisterMessages()| after async call to initialize |
| 49 // StorageMonitor. |
| 50 void RegisterOnStorageMonitorInit(); |
| 51 |
43 PrefChangeRegistrar pref_change_registrar_; | 52 PrefChangeRegistrar pref_change_registrar_; |
44 | 53 |
45 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; | 54 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
46 | 55 |
| 56 base::WeakPtrFactory<MediaGalleriesHandler> weak_ptr_factory_; |
| 57 |
47 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesHandler); | 58 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesHandler); |
48 }; | 59 }; |
49 | 60 |
50 } // namespace options | 61 } // namespace options |
51 | 62 |
52 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MEDIA_GALLERIES_HANDLER_H_ | 63 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MEDIA_GALLERIES_HANDLER_H_ |
OLD | NEW |