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 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h" | 5 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/media_gallery/media_galleries_preferences_factory.h" | 9 #include "chrome/browser/media_gallery/media_galleries_preferences_factory.h" |
10 #include "chrome/browser/ui/chrome_select_file_policy.h" | 10 #include "chrome/browser/ui/chrome_select_file_policy.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 void MediaGalleriesDialogController::DialogFinished(bool accepted) { | 110 void MediaGalleriesDialogController::DialogFinished(bool accepted) { |
111 if (accepted) | 111 if (accepted) |
112 SavePermissions(); | 112 SavePermissions(); |
113 | 113 |
114 on_finish_.Run(); | 114 on_finish_.Run(); |
115 delete this; | 115 delete this; |
116 } | 116 } |
117 | 117 |
| 118 const MediaGalleriesDialogController::KnownGalleryPermissions& |
| 119 MediaGalleriesDialogController::permissions() const { |
| 120 return known_galleries_; |
| 121 } |
| 122 |
118 void MediaGalleriesDialogController::FileSelected(const FilePath& path, | 123 void MediaGalleriesDialogController::FileSelected(const FilePath& path, |
119 int index, | 124 int index, |
120 void* params) { | 125 void* params) { |
121 // Try to find it in |known_galleries_|. | 126 // Try to find it in |known_galleries_|. |
122 MediaGalleryPrefInfo gallery; | 127 MediaGalleryPrefInfo gallery; |
123 if (preferences_->LookUpGalleryByPath(path, &gallery) && | 128 if (preferences_->LookUpGalleryByPath(path, &gallery) && |
124 gallery.type != MediaGalleryPrefInfo::kBlackListed) { | 129 gallery.type != MediaGalleryPrefInfo::kBlackListed) { |
125 KnownGalleryPermissions::iterator iter = | 130 KnownGalleryPermissions::iterator iter = |
126 known_galleries_.find(gallery.pref_id); | 131 known_galleries_.find(gallery.pref_id); |
127 | 132 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 preferences_->SetGalleryPermissionForExtension( | 196 preferences_->SetGalleryPermissionForExtension( |
192 *extension_, id, true); | 197 *extension_, id, true); |
193 } | 198 } |
194 } | 199 } |
195 | 200 |
196 // MediaGalleries dialog ------------------------------------------------------- | 201 // MediaGalleries dialog ------------------------------------------------------- |
197 | 202 |
198 MediaGalleriesDialog::~MediaGalleriesDialog() {} | 203 MediaGalleriesDialog::~MediaGalleriesDialog() {} |
199 | 204 |
200 } // namespace chrome | 205 } // namespace chrome |
OLD | NEW |