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

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

Issue 16533: Convert download manager to FilePath. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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/win_util.h ('k') | 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 (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 #include "chrome/common/win_util.h" 5 #include "chrome/common/win_util.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlapp.h> 8 #include <atlapp.h>
9 #include <commdlg.h> 9 #include <commdlg.h>
10 #include <dwmapi.h> 10 #include <dwmapi.h>
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 const ITEMIDLIST* highlight[] = { 217 const ITEMIDLIST* highlight[] = {
218 {file_item}, 218 {file_item},
219 }; 219 };
220 (*open_folder_and_select_itemsPtr)(dir_item, arraysize(highlight), 220 (*open_folder_and_select_itemsPtr)(dir_item, arraysize(highlight),
221 highlight, NULL); 221 highlight, NULL);
222 } 222 }
223 223
224 // Open an item via a shell execute command. Error code checking and casting 224 // Open an item via a shell execute command. Error code checking and casting
225 // explanation: http://msdn2.microsoft.com/en-us/library/ms647732.aspx 225 // explanation: http://msdn2.microsoft.com/en-us/library/ms647732.aspx
226 bool OpenItemViaShell(const std::wstring& full_path, bool ask_for_app) { 226 bool OpenItemViaShell(const FilePath& full_path, bool ask_for_app) {
227 HINSTANCE h = ::ShellExecuteW( 227 HINSTANCE h = ::ShellExecuteW(
228 NULL, NULL, full_path.c_str(), NULL, 228 NULL, NULL, full_path.value().c_str(), NULL,
229 file_util::GetDirectoryFromPath(full_path).c_str(), SW_SHOWNORMAL); 229 full_path.DirName().value().c_str(), SW_SHOWNORMAL);
230 230
231 LONG_PTR error = reinterpret_cast<LONG_PTR>(h); 231 LONG_PTR error = reinterpret_cast<LONG_PTR>(h);
232 if (error > 32) 232 if (error > 32)
233 return true; 233 return true;
234 234
235 if ((error == SE_ERR_NOASSOC) && ask_for_app) 235 if ((error == SE_ERR_NOASSOC) && ask_for_app)
236 return OpenItemWithExternalApp(full_path); 236 return OpenItemWithExternalApp(full_path);
237 237
238 return false; 238 return false;
239 } 239 }
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 } 892 }
893 893
894 ChromeFont GetWindowTitleFont() { 894 ChromeFont GetWindowTitleFont() {
895 NONCLIENTMETRICS ncm; 895 NONCLIENTMETRICS ncm;
896 win_util::GetNonClientMetrics(&ncm); 896 win_util::GetNonClientMetrics(&ncm);
897 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); 897 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
898 return ChromeFont::CreateFont(caption_font); 898 return ChromeFont::CreateFont(caption_font);
899 } 899 }
900 900
901 } // namespace win_util 901 } // namespace win_util
OLDNEW
« no previous file with comments | « chrome/common/win_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698