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

Unified Diff: win8/metro_driver/chrome_app_view_ash.cc

Issue 14282002: Added support for displaying the select folder picker in Chrome ASH on Windows 8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: win8/metro_driver/chrome_app_view_ash.cc
===================================================================
--- win8/metro_driver/chrome_app_view_ash.cc (revision 194196)
+++ win8/metro_driver/chrome_app_view_ash.cc (working copy)
@@ -81,6 +81,8 @@
OnDisplayFileOpenDialog)
IPC_MESSAGE_HANDLER(MetroViewerHostMsg_DisplayFileSaveAs,
OnDisplayFileSaveAsDialog)
+ IPC_MESSAGE_HANDLER(MetroViewerHostMsg_DisplaySelectFolder,
+ OnDisplayFolderPicker)
IPC_MESSAGE_UNHANDLED(__debugbreak())
IPC_END_MESSAGE_MAP()
return true;
@@ -121,6 +123,14 @@
params));
}
+ void OnDisplayFolderPicker(const string16& title) {
+ ui_proxy_->PostTask(
+ FROM_HERE,
+ base::Bind(&ChromeAppViewAsh::OnDisplayFolderPicker,
+ base::Unretained(app_view_),
+ title));
+ }
+
scoped_refptr<base::MessageLoopProxy> ui_proxy_;
ChromeAppViewAsh* app_view_;
};
@@ -477,13 +487,13 @@
// The OpenFilePickerSession instance is deleted when we receive a
// callback from the OpenFilePickerSession class about the completion of the
// operation.
- OpenFilePickerSession* open_file_picker =
+ FilePickerSessionBase* file_picker_ =
new OpenFilePickerSession(this,
title,
filter,
default_path,
allow_multiple_files);
- open_file_picker->Run();
+ file_picker_->Run();
}
void ChromeAppViewAsh::OnDisplayFileSaveAsDialog(
@@ -491,13 +501,22 @@
DVLOG(1) << __FUNCTION__;
// The SaveFilePickerSession instance is deleted when we receive a
- // callback from the OpenFilePickerSession class about the completion of the
+ // callback from the SaveFilePickerSession class about the completion of the
// operation.
- SaveFilePickerSession* save_file_picker =
+ FilePickerSessionBase* file_picker_ =
new SaveFilePickerSession(this, params);
- save_file_picker->Run();
+ file_picker_->Run();
}
+void ChromeAppViewAsh::OnDisplayFolderPicker(const string16& title) {
+ DVLOG(1) << __FUNCTION__;
+ // The FolderPickerSession instance is deleted when we receive a
+ // callback from the FolderPickerSession class about the completion of the
+ // operation.
+ FilePickerSessionBase* file_picker_ = new FolderPickerSession(this, title);
+ file_picker_->Run();
+}
+
void ChromeAppViewAsh::OnOpenFileCompleted(
OpenFilePickerSession* open_file_picker,
bool success) {
@@ -529,6 +548,19 @@
delete save_file_picker;
}
+void ChromeAppViewAsh::OnFolderPickerCompleted(
+ FolderPickerSession* folder_picker,
+ bool success) {
+ DVLOG(1) << __FUNCTION__;
+ DVLOG(1) << "Success: " << success;
+ if (ui_channel_) {
+ ui_channel_->Send(new MetroViewerHostMsg_SelectFolderDone(
+ success,
+ folder_picker->result()));
+ }
+ delete folder_picker;
+}
+
HRESULT ChromeAppViewAsh::OnActivate(
winapp::Core::ICoreApplicationView*,
winapp::Activation::IActivatedEventArgs* args) {

Powered by Google App Engine
This is Rietveld 408576698