Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: chrome/browser/media_gallery/media_galleries_dialog_controller.cc

Issue 10832330: disable [add folder] button for media galleries dialog if (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/media_galleries/media_galleries_api.cc ('k') | chrome/browser/ui/chrome_select_file_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698