| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/platform_util.h" | 5 #include "chrome/common/platform_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> |
| 11 #include <shellapi.h> | 11 #include <shellapi.h> |
| 12 #include <shlobj.h> | 12 #include <shlobj.h> |
| 13 | 13 |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 16 #include "base/gfx/native_widget_types.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "chrome/common/win_util.h" | 18 #include "chrome/common/win_util.h" |
| 18 | 19 |
| 19 namespace platform_util { | 20 namespace platform_util { |
| 20 | 21 |
| 21 void ShowItemInFolder(const FilePath& full_path) { | 22 void ShowItemInFolder(const FilePath& full_path) { |
| 22 FilePath dir = full_path.DirName(); | 23 FilePath dir = full_path.DirName(); |
| 23 // ParseDisplayName will fail if the directory is "C:", it must be "C:\\". | 24 // ParseDisplayName will fail if the directory is "C:", it must be "C:\\". |
| 24 if (dir.value() == L"" || !file_util::EnsureEndsWithSeparator(&dir)) | 25 if (dir.value() == L"" || !file_util::EnsureEndsWithSeparator(&dir)) |
| 25 return; | 26 return; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 if (FAILED(hr)) | 74 if (FAILED(hr)) |
| 74 return; | 75 return; |
| 75 | 76 |
| 76 const ITEMIDLIST* highlight[] = { | 77 const ITEMIDLIST* highlight[] = { |
| 77 {file_item}, | 78 {file_item}, |
| 78 }; | 79 }; |
| 79 (*open_folder_and_select_itemsPtr)(dir_item, arraysize(highlight), | 80 (*open_folder_and_select_itemsPtr)(dir_item, arraysize(highlight), |
| 80 highlight, NULL); | 81 highlight, NULL); |
| 81 } | 82 } |
| 82 | 83 |
| 84 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { |
| 85 return GetAncestor(view, GA_ROOT); |
| 86 } |
| 87 |
| 83 } // namespace platform_util | 88 } // namespace platform_util |
| OLD | NEW |