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

Unified Diff: ui/aura/remote_root_window_host_win.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: ui/aura/remote_root_window_host_win.cc
===================================================================
--- ui/aura/remote_root_window_host_win.cc (revision 194196)
+++ ui/aura/remote_root_window_host_win.cc (working copy)
@@ -93,6 +93,13 @@
callback);
}
+void HandleSelectFolder(const string16& title,
+ const SelectFolderCompletion& callback) {
+ DCHECK(aura::RemoteRootWindowHostWin::Instance());
+ aura::RemoteRootWindowHostWin::Instance()->HandleSelectFolder(title,
+ callback);
+}
+
RemoteRootWindowHostWin* g_instance = NULL;
RemoteRootWindowHostWin* RemoteRootWindowHostWin::Instance() {
@@ -145,6 +152,8 @@
OnFileOpenDone)
IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MultiFileOpenDone,
OnMultiFileOpenDone)
+ IPC_MESSAGE_HANDLER(MetroViewerHostMsg_SelectFolderDone,
+ OnSelectFolderDone)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -158,7 +167,7 @@
if (!host_)
return;
- // Can only one of these operations in flight.
+ // Can only have have one of these operations in flight.
palmer 2013/04/18 22:58:08 Only need one "have". :)
ananta 2013/04/19 00:23:24 Done.
DCHECK(file_open_completion_callback_.is_null());
file_open_completion_callback_ = callback;
@@ -176,7 +185,7 @@
if (!host_)
return;
- // Can only one of these operations in flight.
+ // Can only have one of these operations in flight.
DCHECK(multi_file_open_completion_callback_.is_null());
multi_file_open_completion_callback_ = callback;
@@ -202,13 +211,26 @@
params.filter = filter;
params.filter_index = filter_index;
- // Can only one of these operations in flight.
+ // Can only have one of these operations in flight.
DCHECK(file_saveas_completion_callback_.is_null());
file_saveas_completion_callback_ = callback;
host_->Send(new MetroViewerHostMsg_DisplayFileSaveAs(params));
}
+void RemoteRootWindowHostWin::HandleSelectFolder(
+ const string16& title,
+ const SelectFolderCompletion& callback) {
+ if (!host_)
+ return;
+
+ // Can only have one of these operations in flight.
+ DCHECK(select_folder_completion_callback_.is_null());
+ select_folder_completion_callback_ = callback;
+
+ host_->Send(new MetroViewerHostMsg_DisplaySelectFolder(title));
+}
+
void RemoteRootWindowHostWin::SetDelegate(RootWindowHostDelegate* delegate) {
delegate_ = delegate;
}
@@ -431,6 +453,14 @@
multi_file_open_completion_callback_.Reset();
}
+void RemoteRootWindowHostWin::OnSelectFolderDone(bool success,
+ const string16& folder) {
+ if (success) {
+ select_folder_completion_callback_.Run(base::FilePath(folder), 0, NULL);
+ }
+ select_folder_completion_callback_.Reset();
+}
+
void RemoteRootWindowHostWin::DispatchKeyboardMessage(ui::EventType type,
uint32 vkey,
uint32 repeat_count,

Powered by Google App Engine
This is Rietveld 408576698