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

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: Another rebase Created 8 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_process_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (!GetFilePathOfFileEntry(filesystem_name, filesystem_path, 100 if (!GetFilePathOfFileEntry(filesystem_name, filesystem_path,
101 render_view_host_, &file_path, &error_)) { 101 render_view_host_, &file_path, &error_)) {
102 return false; 102 return false;
103 } 103 }
104 104
105 result_.reset(base::Value::CreateStringValue(file_path.value())); 105 result_.reset(base::Value::CreateStringValue(file_path.value()));
106 return true; 106 return true;
107 } 107 }
108 108
109 // Handles showing a dialog to the user to ask for the filename for a file to 109 // Handles showing a dialog to the user to ask for the filename for a file to
110 // save. 110 // save or open.
111 class FileSystemPickerFunction::FilePicker : public SelectFileDialog::Listener { 111 class FileSystemPickerFunction::FilePicker : public SelectFileDialog::Listener {
112 public: 112 public:
113 FilePicker(FileSystemPickerFunction* function, 113 FilePicker(FileSystemPickerFunction* function,
114 content::WebContents* web_contents, 114 content::WebContents* web_contents,
115 const FilePath& suggested_path, 115 const FilePath& suggested_path,
116 bool for_save) 116 bool for_save)
117 : suggested_path_(suggested_path), 117 : suggested_path_(suggested_path),
118 for_save_(for_save), 118 for_save_(for_save),
119 function_(function) { 119 function_(function) {
120 select_file_dialog_ = SelectFileDialog::Create(this); 120 select_file_dialog_ = SelectFileDialog::Create(this);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 file_system::ChooseFileOptions* options = params->options.get(); 311 file_system::ChooseFileOptions* options = params->options.get();
312 if (options) { 312 if (options) {
313 if (options->type.get() && *options->type == kSaveFileOption) 313 if (options->type.get() && *options->type == kSaveFileOption)
314 for_save = true; 314 for_save = true;
315 } 315 }
316 316
317 return ShowPicker(FilePath(), for_save); 317 return ShowPicker(FilePath(), for_save);
318 } 318 }
319 319
320 } // namespace extensions 320 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_process_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698