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

Side by Side Diff: chrome/utility/shell_handler_win.cc

Issue 544123003: Add in a missing call to propagate the extension choices to the Save As dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/utility/shell_handler_win.h" 5 #include "chrome/utility/shell_handler_win.h"
6 6
7 #include <commdlg.h> 7 #include <commdlg.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 content::UtilityThread::Get()->Send( 57 content::UtilityThread::Get()->Send(
58 new ChromeUtilityHostMsg_GetOpenFileName_Failed()); 58 new ChromeUtilityHostMsg_GetOpenFileName_Failed());
59 } 59 }
60 } 60 }
61 61
62 void ShellHandler::OnGetSaveFileName( 62 void ShellHandler::OnGetSaveFileName(
63 const ChromeUtilityMsg_GetSaveFileName_Params& params) { 63 const ChromeUtilityMsg_GetSaveFileName_Params& params) {
64 ui::win::OpenFileName open_file_name(params.owner, params.flags); 64 ui::win::OpenFileName open_file_name(params.owner, params.flags);
65 open_file_name.SetInitialSelection(params.initial_directory, 65 open_file_name.SetInitialSelection(params.initial_directory,
66 params.suggested_filename); 66 params.suggested_filename);
67 open_file_name.SetFilters(params.filters);
67 open_file_name.GetOPENFILENAME()->nFilterIndex = 68 open_file_name.GetOPENFILENAME()->nFilterIndex =
68 params.one_based_filter_index; 69 params.one_based_filter_index;
69 open_file_name.GetOPENFILENAME()->lpstrDefExt = 70 open_file_name.GetOPENFILENAME()->lpstrDefExt =
70 params.default_extension.c_str(); 71 params.default_extension.c_str();
71 72
72 open_file_name.MaybeInstallWindowPositionHookForSaveAsOnXP(); 73 open_file_name.MaybeInstallWindowPositionHookForSaveAsOnXP();
73 74
74 if (::GetSaveFileName(open_file_name.GetOPENFILENAME())) { 75 if (::GetSaveFileName(open_file_name.GetOPENFILENAME())) {
75 content::UtilityThread::Get()->Send( 76 content::UtilityThread::Get()->Send(
76 new ChromeUtilityHostMsg_GetSaveFileName_Result( 77 new ChromeUtilityHostMsg_GetSaveFileName_Result(
77 base::FilePath(open_file_name.GetOPENFILENAME()->lpstrFile), 78 base::FilePath(open_file_name.GetOPENFILENAME()->lpstrFile),
78 open_file_name.GetOPENFILENAME()->nFilterIndex)); 79 open_file_name.GetOPENFILENAME()->nFilterIndex));
79 return; 80 return;
80 } 81 }
81 82
82 // Zero means the dialog was closed, otherwise we had an error. 83 // Zero means the dialog was closed, otherwise we had an error.
83 DWORD error_code = ::CommDlgExtendedError(); 84 DWORD error_code = ::CommDlgExtendedError();
84 if (error_code != 0) 85 if (error_code != 0)
85 NOTREACHED() << "GetSaveFileName failed with code: " << error_code; 86 NOTREACHED() << "GetSaveFileName failed with code: " << error_code;
86 87
87 content::UtilityThread::Get()->Send( 88 content::UtilityThread::Get()->Send(
88 new ChromeUtilityHostMsg_GetSaveFileName_Failed()); 89 new ChromeUtilityHostMsg_GetSaveFileName_Failed());
89 } 90 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698