| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_CONTROLLER_H_ | 
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_CONTROLLER_H_ | 
| 7 | 7 | 
| 8 #include <map> | 8 #include <map> | 
| 9 #include <set> | 9 #include <set> | 
| 10 #include <string> | 10 #include <string> | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 45       MediaGalleriesPreferences* preferences, | 45       MediaGalleriesPreferences* preferences, | 
| 46       const extensions::Extension* extension); | 46       const extensions::Extension* extension); | 
| 47 | 47 | 
| 48   // The constructor creates a dialog controller which owns itself. | 48   // The constructor creates a dialog controller which owns itself. | 
| 49   MediaGalleriesScanResultController( | 49   MediaGalleriesScanResultController( | 
| 50       content::WebContents* web_contents, | 50       content::WebContents* web_contents, | 
| 51       const extensions::Extension& extension, | 51       const extensions::Extension& extension, | 
| 52       const base::Closure& on_finish); | 52       const base::Closure& on_finish); | 
| 53 | 53 | 
| 54   // MediaGalleriesDialogController implementation. | 54   // MediaGalleriesDialogController implementation. | 
| 55   virtual base::string16 GetHeader() const OVERRIDE; | 55   virtual base::string16 GetHeader() const override; | 
| 56   virtual base::string16 GetSubtext() const OVERRIDE; | 56   virtual base::string16 GetSubtext() const override; | 
| 57   virtual bool IsAcceptAllowed() const OVERRIDE; | 57   virtual bool IsAcceptAllowed() const override; | 
| 58   virtual bool ShouldShowFolderViewer(const Entry& entry) const OVERRIDE; | 58   virtual bool ShouldShowFolderViewer(const Entry& entry) const override; | 
| 59   virtual std::vector<base::string16> GetSectionHeaders() const OVERRIDE; | 59   virtual std::vector<base::string16> GetSectionHeaders() const override; | 
| 60   virtual Entries GetSectionEntries(size_t index) const OVERRIDE; | 60   virtual Entries GetSectionEntries(size_t index) const override; | 
| 61   virtual base::string16 GetAuxiliaryButtonText() const OVERRIDE; | 61   virtual base::string16 GetAuxiliaryButtonText() const override; | 
| 62   virtual void DidClickAuxiliaryButton() OVERRIDE; | 62   virtual void DidClickAuxiliaryButton() override; | 
| 63   virtual void DidToggleEntry(MediaGalleryPrefId id, bool selected) OVERRIDE; | 63   virtual void DidToggleEntry(MediaGalleryPrefId id, bool selected) override; | 
| 64   virtual void DidClickOpenFolderViewer(MediaGalleryPrefId id) OVERRIDE; | 64   virtual void DidClickOpenFolderViewer(MediaGalleryPrefId id) override; | 
| 65   virtual void DidForgetEntry(MediaGalleryPrefId id) OVERRIDE; | 65   virtual void DidForgetEntry(MediaGalleryPrefId id) override; | 
| 66   virtual base::string16 GetAcceptButtonText() const OVERRIDE; | 66   virtual base::string16 GetAcceptButtonText() const override; | 
| 67   virtual void DialogFinished(bool accepted) OVERRIDE; | 67   virtual void DialogFinished(bool accepted) override; | 
| 68   virtual ui::MenuModel* GetContextMenu(MediaGalleryPrefId id) OVERRIDE; | 68   virtual ui::MenuModel* GetContextMenu(MediaGalleryPrefId id) override; | 
| 69   virtual content::WebContents* WebContents() OVERRIDE; | 69   virtual content::WebContents* WebContents() override; | 
| 70 | 70 | 
| 71  protected: | 71  protected: | 
| 72   typedef base::Callback<MediaGalleriesDialog* ( | 72   typedef base::Callback<MediaGalleriesDialog* ( | 
| 73       MediaGalleriesDialogController*)> CreateDialogCallback; | 73       MediaGalleriesDialogController*)> CreateDialogCallback; | 
| 74   typedef std::map<MediaGalleryPrefId, Entry> ScanResults; | 74   typedef std::map<MediaGalleryPrefId, Entry> ScanResults; | 
| 75 | 75 | 
| 76   // Updates |scan_results| from |preferences|. Will not add galleries from | 76   // Updates |scan_results| from |preferences|. Will not add galleries from | 
| 77   // |ignore_list| onto |scan_results|. | 77   // |ignore_list| onto |scan_results|. | 
| 78   static void UpdateScanResultsFromPreferences( | 78   static void UpdateScanResultsFromPreferences( | 
| 79       MediaGalleriesPreferences* preferences, | 79       MediaGalleriesPreferences* preferences, | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
| 102   void OnPreferenceUpdate(const std::string& extension_id); | 102   void OnPreferenceUpdate(const std::string& extension_id); | 
| 103 | 103 | 
| 104   // Used to keep the dialog in sync with attached and detached devices. | 104   // Used to keep the dialog in sync with attached and detached devices. | 
| 105   void OnRemovableDeviceUpdate(const std::string device_id); | 105   void OnRemovableDeviceUpdate(const std::string device_id); | 
| 106 | 106 | 
| 107   Profile* GetProfile() const; | 107   Profile* GetProfile() const; | 
| 108 | 108 | 
| 109   // RemovableStorageObserver implementation. | 109   // RemovableStorageObserver implementation. | 
| 110   // Used to keep dialog in sync with removable device status. | 110   // Used to keep dialog in sync with removable device status. | 
| 111   virtual void OnRemovableStorageAttached( | 111   virtual void OnRemovableStorageAttached( | 
| 112       const storage_monitor::StorageInfo& info) OVERRIDE; | 112       const storage_monitor::StorageInfo& info) override; | 
| 113   virtual void OnRemovableStorageDetached( | 113   virtual void OnRemovableStorageDetached( | 
| 114       const storage_monitor::StorageInfo& info) OVERRIDE; | 114       const storage_monitor::StorageInfo& info) override; | 
| 115 | 115 | 
| 116   // MediaGalleriesPreferences::GalleryChangeObserver implementations. | 116   // MediaGalleriesPreferences::GalleryChangeObserver implementations. | 
| 117   // Used to keep the dialog in sync when the preferences change. | 117   // Used to keep the dialog in sync when the preferences change. | 
| 118   virtual void OnPermissionAdded(MediaGalleriesPreferences* pref, | 118   virtual void OnPermissionAdded(MediaGalleriesPreferences* pref, | 
| 119                                  const std::string& extension_id, | 119                                  const std::string& extension_id, | 
| 120                                  MediaGalleryPrefId pref_id) OVERRIDE; | 120                                  MediaGalleryPrefId pref_id) override; | 
| 121   virtual void OnPermissionRemoved(MediaGalleriesPreferences* pref, | 121   virtual void OnPermissionRemoved(MediaGalleriesPreferences* pref, | 
| 122                                    const std::string& extension_id, | 122                                    const std::string& extension_id, | 
| 123                                    MediaGalleryPrefId pref_id) OVERRIDE; | 123                                    MediaGalleryPrefId pref_id) override; | 
| 124   virtual void OnGalleryAdded(MediaGalleriesPreferences* pref, | 124   virtual void OnGalleryAdded(MediaGalleriesPreferences* pref, | 
| 125                               MediaGalleryPrefId pref_id) OVERRIDE; | 125                               MediaGalleryPrefId pref_id) override; | 
| 126   virtual void OnGalleryRemoved(MediaGalleriesPreferences* pref, | 126   virtual void OnGalleryRemoved(MediaGalleriesPreferences* pref, | 
| 127                                 MediaGalleryPrefId pref_id) OVERRIDE; | 127                                 MediaGalleryPrefId pref_id) override; | 
| 128   virtual void OnGalleryInfoUpdated(MediaGalleriesPreferences* pref, | 128   virtual void OnGalleryInfoUpdated(MediaGalleriesPreferences* pref, | 
| 129                                     MediaGalleryPrefId pref_id) OVERRIDE; | 129                                     MediaGalleryPrefId pref_id) override; | 
| 130 | 130 | 
| 131   // The web contents from which the request originated. | 131   // The web contents from which the request originated. | 
| 132   content::WebContents* web_contents_; | 132   content::WebContents* web_contents_; | 
| 133 | 133 | 
| 134   // This is just a reference, but it's assumed that it won't become invalid | 134   // This is just a reference, but it's assumed that it won't become invalid | 
| 135   // while the dialog is showing. | 135   // while the dialog is showing. | 
| 136   const extensions::Extension* extension_; | 136   const extensions::Extension* extension_; | 
| 137 | 137 | 
| 138   // The scan results that aren't blacklisted and this extension doesn't | 138   // The scan results that aren't blacklisted and this extension doesn't | 
| 139   // already have access to. | 139   // already have access to. | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 155 | 155 | 
| 156   // The view that's showing. | 156   // The view that's showing. | 
| 157   scoped_ptr<MediaGalleriesDialog> dialog_; | 157   scoped_ptr<MediaGalleriesDialog> dialog_; | 
| 158 | 158 | 
| 159   scoped_ptr<MediaGalleryContextMenu> context_menu_; | 159   scoped_ptr<MediaGalleryContextMenu> context_menu_; | 
| 160 | 160 | 
| 161   DISALLOW_COPY_AND_ASSIGN(MediaGalleriesScanResultController); | 161   DISALLOW_COPY_AND_ASSIGN(MediaGalleriesScanResultController); | 
| 162 }; | 162 }; | 
| 163 | 163 | 
| 164 #endif  // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_CONTROLLER
     _H_ | 164 #endif  // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_CONTROLLER
     _H_ | 
| OLD | NEW | 
|---|