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

Side by Side Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 10584026: Allow ChromeOS file selection dialog to be shown from shell windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Uses BaseWindow instead of Browser Created 8 years, 6 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/extensions/api/file_system/file_system_api.h" 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "chrome/browser/extensions/shell_window_registry.h" 10 #include "chrome/browser/extensions/shell_window_registry.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (!GetFilePathOfFileEntry(filesystem_name, filesystem_path, 97 if (!GetFilePathOfFileEntry(filesystem_name, filesystem_path,
98 render_view_host_, &file_path, &error_)) { 98 render_view_host_, &file_path, &error_)) {
99 return false; 99 return false;
100 } 100 }
101 101
102 result_.reset(base::Value::CreateStringValue(file_path.value())); 102 result_.reset(base::Value::CreateStringValue(file_path.value()));
103 return true; 103 return true;
104 } 104 }
105 105
106 // Handles showing a dialog to the user to ask for the filename for a file to 106 // Handles showing a dialog to the user to ask for the filename for a file to
107 // save. 107 // save or open.
108 class FileSystemPickerFunction::FilePicker : public SelectFileDialog::Listener { 108 class FileSystemPickerFunction::FilePicker : public SelectFileDialog::Listener {
109 public: 109 public:
110 FilePicker(FileSystemPickerFunction* function, 110 FilePicker(FileSystemPickerFunction* function,
111 content::WebContents* web_contents, 111 content::WebContents* web_contents,
112 const FilePath& suggested_path, 112 const FilePath& suggested_path,
113 bool for_save) 113 bool for_save)
114 : suggested_path_(suggested_path), 114 : suggested_path_(suggested_path),
115 for_save_(for_save), 115 for_save_(for_save),
116 function_(function) { 116 function_(function) {
117 select_file_dialog_ = SelectFileDialog::Create(this); 117 select_file_dialog_ = SelectFileDialog::Create(this);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 file_system::ChooseFileOptions* options = params->options.get(); 275 file_system::ChooseFileOptions* options = params->options.get();
276 if (options) { 276 if (options) {
277 if (options->type.get() && *options->type == kSaveFileOption) 277 if (options->type.get() && *options->type == kSaveFileOption)
278 for_save = true; 278 for_save = true;
279 } 279 }
280 280
281 return ShowPicker(FilePath(), for_save); 281 return ShowPicker(FilePath(), for_save);
282 } 282 }
283 283
284 } // namespace extensions 284 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_process_manager.h » ('j') | chrome/browser/ui/extensions/shell_window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698