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

Side by Side Diff: chrome/browser/platform_util_win.cc

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 7 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/platform_util.h" 5 #include "chrome/browser/platform_util.h"
6 6
7 #include <commdlg.h> 7 #include <commdlg.h>
8 #include <dwmapi.h> 8 #include <dwmapi.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 13 matching lines...) Expand all
24 #include "googleurl/src/gurl.h" 24 #include "googleurl/src/gurl.h"
25 #include "ui/base/win/shell.h" 25 #include "ui/base/win/shell.h"
26 #include "ui/gfx/native_widget_types.h" 26 #include "ui/gfx/native_widget_types.h"
27 27
28 using content::BrowserThread; 28 using content::BrowserThread;
29 29
30 namespace { 30 namespace {
31 31
32 void ShowItemInFolderOnFileThread(const base::FilePath& full_path) { 32 void ShowItemInFolderOnFileThread(const base::FilePath& full_path) {
33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
34 base::FilePath dir = full_path.DirName(); 34 base::FilePath dir = full_path.DirName().AsEndingWithSeparator();
35 // ParseDisplayName will fail if the directory is "C:", it must be "C:\\". 35 // ParseDisplayName will fail if the directory is "C:", it must be "C:\\".
36 if (dir.value() == L"" || !file_util::EnsureEndsWithSeparator(&dir)) 36 if (dir.empty())
37 return; 37 return;
38 38
39 typedef HRESULT (WINAPI *SHOpenFolderAndSelectItemsFuncPtr)( 39 typedef HRESULT (WINAPI *SHOpenFolderAndSelectItemsFuncPtr)(
40 PCIDLIST_ABSOLUTE pidl_Folder, 40 PCIDLIST_ABSOLUTE pidl_Folder,
41 UINT cidl, 41 UINT cidl,
42 PCUITEMID_CHILD_ARRAY pidls, 42 PCUITEMID_CHILD_ARRAY pidls,
43 DWORD flags); 43 DWORD flags);
44 44
45 static SHOpenFolderAndSelectItemsFuncPtr open_folder_and_select_itemsPtr = 45 static SHOpenFolderAndSelectItemsFuncPtr open_folder_and_select_itemsPtr =
46 NULL; 46 NULL;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 ::SetForegroundWindow(window); 197 ::SetForegroundWindow(window);
198 } 198 }
199 199
200 bool IsVisible(gfx::NativeView view) { 200 bool IsVisible(gfx::NativeView view) {
201 // MSVC complains if we don't include != 0. 201 // MSVC complains if we don't include != 0.
202 return ::IsWindowVisible(view) != 0; 202 return ::IsWindowVisible(view) != 0;
203 } 203 }
204 #endif 204 #endif
205 205
206 } // namespace platform_util 206 } // namespace platform_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698