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