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

Side by Side Diff: chrome/common/win_util.h

Issue 63093: Refactoring; switch the |filter| parameter into something that is more amenab... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/temp_scaffolding_stubs.h ('k') | chrome/common/win_util.cc » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_COMMON_WIN_UTIL_H_ 5 #ifndef CHROME_COMMON_WIN_UTIL_H_
6 #define CHROME_COMMON_WIN_UTIL_H_ 6 #define CHROME_COMMON_WIN_UTIL_H_
7 7
8 #include <objbase.h> 8 #include <objbase.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // zone on all downloads. This function is equivalent to OpenItemViaShell 126 // zone on all downloads. This function is equivalent to OpenItemViaShell
127 // without showing the zone warning dialog. 127 // without showing the zone warning dialog.
128 bool OpenItemViaShellNoZoneCheck(const FilePath& full_path, 128 bool OpenItemViaShellNoZoneCheck(const FilePath& full_path,
129 bool ask_for_app); 129 bool ask_for_app);
130 130
131 // Ask the user, via the Windows "Open With" dialog, for an application to use 131 // Ask the user, via the Windows "Open With" dialog, for an application to use
132 // to open the file specified by 'full_path'. 132 // to open the file specified by 'full_path'.
133 // Returns 'true' on successful open, 'false' otherwise. 133 // Returns 'true' on successful open, 'false' otherwise.
134 bool OpenItemWithExternalApp(const std::wstring& full_path); 134 bool OpenItemWithExternalApp(const std::wstring& full_path);
135 135
136 std::wstring GetFileFilterFromPath(const std::wstring& file_name); 136 // Set up a filter for a Save/Open dialog, which will consist of |file_ext| file
137 137 // extensions (internally separated by semicolons), |ext_desc| as the text
138 // Returns a file filter whose description comes from the OS for the first file 138 // descriptions of the |file_ext| types (optional), and (optionally) the default
139 // extension in |extensions|. |extensions| is a semicolon separated list of 139 // 'All Files' view. The purpose of the filter is to show only files of a
140 // extensions. Each extension is specified as '*.foo' where foo is the 140 // particular type in a Windows Save/Open dialog box. The resulting filter is
141 // extension. 141 // returned. The filters created here are:
142 std::wstring GetFileFilterFromExtensions(const std::wstring& extensions, 142 // 1. only files that have 'file_ext' as their extension
143 bool include_all_files); 143 // 2. all files (only added if 'include_all_files' is true)
144 // Example:
145 // file_ext: { ".txt", ".htm;.html" }
146 // ext_desc: { "Text Document" }
147 // returned: "Text Document\0*.txt\0HTML Document\0.htm;.html\0"
148 // "All Files\0*.*\0\0" (in one big string)
149 std::wstring FormatFilterForExtensions(
150 const std::vector<std::wstring>& file_ext,
151 const std::vector<std::wstring>& ext_desc,
152 bool include_all_files);
144 153
145 // Prompt the user for location to save a file. 'suggested_name' is a full path 154 // Prompt the user for location to save a file. 'suggested_name' is a full path
146 // that gives the dialog box a hint as to how to initialize itself. 155 // that gives the dialog box a hint as to how to initialize itself.
147 // For example, a 'suggested_name' of: 156 // For example, a 'suggested_name' of:
148 // "C:\Documents and Settings\jojo\My Documents\picture.png" 157 // "C:\Documents and Settings\jojo\My Documents\picture.png"
149 // will start the dialog in the "C:\Documents and Settings\jojo\My Documents\" 158 // will start the dialog in the "C:\Documents and Settings\jojo\My Documents\"
150 // directory, and filter for .png file types. 159 // directory, and filter for .png file types.
151 // 'owner' is the window to which the dialog box is modal, NULL for a modeless 160 // 'owner' is the window to which the dialog box is modal, NULL for a modeless
152 // dialog box. 161 // dialog box.
153 // On success, returns true and 'final_name' contains the full path of the file 162 // On success, returns true and 'final_name' contains the full path of the file
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 283
275 // Returns the system set window title font. 284 // Returns the system set window title font.
276 ChromeFont GetWindowTitleFont(); 285 ChromeFont GetWindowTitleFont();
277 286
278 // The thickness of an auto-hide taskbar in pixels. 287 // The thickness of an auto-hide taskbar in pixels.
279 extern const int kAutoHideTaskbarThicknessPx; 288 extern const int kAutoHideTaskbarThicknessPx;
280 289
281 } // namespace win_util 290 } // namespace win_util
282 291
283 #endif // CHROME_COMMON_WIN_UTIL_H_ 292 #endif // CHROME_COMMON_WIN_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/common/temp_scaffolding_stubs.h ('k') | chrome/common/win_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698