OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |