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

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
« no previous file with comments | « ui/aura/remote_root_window_host_win.h ('k') | ui/metro_viewer/metro_viewer_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,13 +167,13 @@
if (!host_)
return;
- // Can only one of these operations in flight.
+ // Can only have one of these operations in flight.
DCHECK(file_open_completion_callback_.is_null());
file_open_completion_callback_ = callback;
host_->Send(new MetroViewerHostMsg_DisplayFileOpen(title,
filter,
- default_path.value(),
+ default_path,
false));
}
@@ -176,13 +185,13 @@
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;
host_->Send(new MetroViewerHostMsg_DisplayFileOpen(title,
filter,
- default_path.value(),
+ default_path,
true));
}
@@ -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;
}
@@ -404,17 +426,17 @@
}
void RemoteRootWindowHostWin::OnFileSaveAsDone(bool success,
- string16 filename,
+ const base::FilePath& filename,
int filter_index) {
if (success) {
- file_saveas_completion_callback_.Run(
- base::FilePath(filename), filter_index, NULL);
+ file_saveas_completion_callback_.Run(filename, filter_index, NULL);
}
file_saveas_completion_callback_.Reset();
}
-void RemoteRootWindowHostWin::OnFileOpenDone(bool success, string16 filename) {
+void RemoteRootWindowHostWin::OnFileOpenDone(bool success,
+ const base::FilePath& filename) {
if (success) {
file_open_completion_callback_.Run(
base::FilePath(filename), 0, NULL);
@@ -431,6 +453,15 @@
multi_file_open_completion_callback_.Reset();
}
+void RemoteRootWindowHostWin::OnSelectFolderDone(
+ bool success,
+ const base::FilePath& 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,
« no previous file with comments | « ui/aura/remote_root_window_host_win.h ('k') | ui/metro_viewer/metro_viewer_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698