| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 iter != permissions().end(); iter++) { | 65 iter != permissions().end(); iter++) { |
| 66 if (iter->second.allowed) | 66 if (iter->second.allowed) |
| 67 return true; | 67 return true; |
| 68 } | 68 } |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void MediaGalleriesDialogController::OnAddFolderClicked() { | 72 void MediaGalleriesDialogController::OnAddFolderClicked() { |
| 73 FilePath user_data_dir; | 73 FilePath user_data_dir; |
| 74 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 74 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
| 75 // TODO(estade): if file dialogs are disabled we need to handle it somehow. | |
| 76 select_folder_dialog_ = | 75 select_folder_dialog_ = |
| 77 ui::SelectFileDialog::Create(this, new ChromeSelectFilePolicy(NULL)); | 76 ui::SelectFileDialog::Create(this, new ChromeSelectFilePolicy(NULL)); |
| 78 select_folder_dialog_->SelectFile( | 77 select_folder_dialog_->SelectFile( |
| 79 ui::SelectFileDialog::SELECT_FOLDER, | 78 ui::SelectFileDialog::SELECT_FOLDER, |
| 80 l10n_util::GetStringUTF16(IDS_MEDIA_GALLERIES_DIALOG_ADD_GALLERY_TITLE), | 79 l10n_util::GetStringUTF16(IDS_MEDIA_GALLERIES_DIALOG_ADD_GALLERY_TITLE), |
| 81 user_data_dir, | 80 user_data_dir, |
| 82 NULL, 0, FILE_PATH_LITERAL(""), | 81 NULL, 0, FILE_PATH_LITERAL(""), |
| 83 tab_contents_->web_contents()->GetView()->GetTopLevelNativeWindow(), | 82 tab_contents_->web_contents()->GetView()->GetTopLevelNativeWindow(), |
| 84 NULL); | 83 NULL); |
| 85 } | 84 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 preferences_->SetGalleryPermissionForExtension( | 195 preferences_->SetGalleryPermissionForExtension( |
| 197 *extension_, id, true); | 196 *extension_, id, true); |
| 198 } | 197 } |
| 199 } | 198 } |
| 200 | 199 |
| 201 // MediaGalleries dialog ------------------------------------------------------- | 200 // MediaGalleries dialog ------------------------------------------------------- |
| 202 | 201 |
| 203 MediaGalleriesDialog::~MediaGalleriesDialog() {} | 202 MediaGalleriesDialog::~MediaGalleriesDialog() {} |
| 204 | 203 |
| 205 } // namespace chrome | 204 } // namespace chrome |
| OLD | NEW |