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_DIALOG_CONTRO
LLER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_DIALOG_CONTRO
LLER_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_DIALOG_CONTRO
LLER_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_DIALOG_CONTRO
LLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 24 matching lines...) Expand all Loading... |
35 class MediaGalleriesScanResultDialog { | 35 class MediaGalleriesScanResultDialog { |
36 public: | 36 public: |
37 virtual ~MediaGalleriesScanResultDialog(); | 37 virtual ~MediaGalleriesScanResultDialog(); |
38 | 38 |
39 // Tell the dialog to update its display list of scan results. | 39 // Tell the dialog to update its display list of scan results. |
40 virtual void UpdateResults() = 0; | 40 virtual void UpdateResults() = 0; |
41 | 41 |
42 // Constructs a platform-specific dialog owned and controlled by |controller|. | 42 // Constructs a platform-specific dialog owned and controlled by |controller|. |
43 static MediaGalleriesScanResultDialog* Create( | 43 static MediaGalleriesScanResultDialog* Create( |
44 MediaGalleriesScanResultDialogController* controller); | 44 MediaGalleriesScanResultDialogController* controller); |
| 45 |
| 46 private: |
| 47 friend class TestMediaGalleriesAddScanResultsFunction; |
| 48 |
| 49 virtual void AcceptDialogForTesting() = 0; |
45 }; | 50 }; |
46 | 51 |
47 // The controller is responsible for handling the logic of the dialog and | 52 // The controller is responsible for handling the logic of the dialog and |
48 // interfacing with the model (i.e., MediaGalleriesPreferences). It shows | 53 // interfacing with the model (i.e., MediaGalleriesPreferences). It shows |
49 // the dialog and owns itself. | 54 // the dialog and owns itself. |
50 class MediaGalleriesScanResultDialogController | 55 class MediaGalleriesScanResultDialogController |
51 : public RemovableStorageObserver, | 56 : public RemovableStorageObserver, |
52 public MediaGalleriesPreferences::GalleryChangeObserver { | 57 public MediaGalleriesPreferences::GalleryChangeObserver { |
53 public: | 58 public: |
54 struct ScanResult { | 59 struct ScanResult { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 const extensions::Extension& extension, | 122 const extensions::Extension& extension, |
118 MediaGalleriesPreferences* preferences_, | 123 MediaGalleriesPreferences* preferences_, |
119 const CreateDialogCallback& create_dialog_callback, | 124 const CreateDialogCallback& create_dialog_callback, |
120 const base::Closure& on_finish); | 125 const base::Closure& on_finish); |
121 | 126 |
122 virtual ~MediaGalleriesScanResultDialogController(); | 127 virtual ~MediaGalleriesScanResultDialogController(); |
123 | 128 |
124 private: | 129 private: |
125 friend class MediaGalleriesScanResultDialogControllerTest; | 130 friend class MediaGalleriesScanResultDialogControllerTest; |
126 friend class MediaGalleriesScanResultDialogCocoaTest; | 131 friend class MediaGalleriesScanResultDialogCocoaTest; |
| 132 friend class TestMediaGalleriesAddScanResultsFunction; |
127 | 133 |
128 // Bottom half of constructor -- called when |preferences_| is initialized. | 134 // Bottom half of constructor -- called when |preferences_| is initialized. |
129 void OnPreferencesInitialized(); | 135 void OnPreferencesInitialized(); |
130 | 136 |
131 // Used to keep the dialog in sync with the preferences. | 137 // Used to keep the dialog in sync with the preferences. |
132 void OnPreferenceUpdate(const std::string& extension_id); | 138 void OnPreferenceUpdate(const std::string& extension_id); |
133 | 139 |
134 // Used to keep the dialog in sync with attached and detached devices. | 140 // Used to keep the dialog in sync with attached and detached devices. |
135 void OnRemovableDeviceUpdate(const std::string device_id); | 141 void OnRemovableDeviceUpdate(const std::string device_id); |
136 | 142 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 189 |
184 // The view that's showing. | 190 // The view that's showing. |
185 scoped_ptr<MediaGalleriesScanResultDialog> dialog_; | 191 scoped_ptr<MediaGalleriesScanResultDialog> dialog_; |
186 | 192 |
187 scoped_ptr<MediaGalleryContextMenu> context_menu_; | 193 scoped_ptr<MediaGalleryContextMenu> context_menu_; |
188 | 194 |
189 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesScanResultDialogController); | 195 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesScanResultDialogController); |
190 }; | 196 }; |
191 | 197 |
192 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_DIALOG_CON
TROLLER_H_ | 198 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_SCAN_RESULT_DIALOG_CON
TROLLER_H_ |
OLD | NEW |