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

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

Issue 112064: Linux: call xdg-open on downloaded files to open them. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix typos Created 11 years, 7 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/platform_util_mac.mm ('k') | chrome/common/win_safe_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) 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>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (FAILED(hr)) 75 if (FAILED(hr))
76 return; 76 return;
77 77
78 const ITEMIDLIST* highlight[] = { 78 const ITEMIDLIST* highlight[] = {
79 {file_item}, 79 {file_item},
80 }; 80 };
81 (*open_folder_and_select_itemsPtr)(dir_item, arraysize(highlight), 81 (*open_folder_and_select_itemsPtr)(dir_item, arraysize(highlight),
82 highlight, NULL); 82 highlight, NULL);
83 } 83 }
84 84
85 void OpenItem(const FilePath& full_path) {
86 win_util::OpenItemViaShell(full_path);
87 }
88
85 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { 89 gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
86 return GetAncestor(view, GA_ROOT); 90 return GetAncestor(view, GA_ROOT);
87 } 91 }
88 92
89 string16 GetWindowTitle(gfx::NativeWindow window_handle) { 93 string16 GetWindowTitle(gfx::NativeWindow window_handle) {
90 std::wstring result; 94 std::wstring result;
91 int length = ::GetWindowTextLength(window_handle) + 1; 95 int length = ::GetWindowTextLength(window_handle) + 1;
92 ::GetWindowText(window_handle, WriteInto(&result, length), length); 96 ::GetWindowText(window_handle, WriteInto(&result, length), length);
93 return WideToUTF16(result); 97 return WideToUTF16(result);
94 } 98 }
95 99
96 bool IsWindowActive(gfx::NativeWindow window) { 100 bool IsWindowActive(gfx::NativeWindow window) {
97 return ::GetForegroundWindow() == window; 101 return ::GetForegroundWindow() == window;
98 } 102 }
99 103
100 bool IsVisible(gfx::NativeView view) { 104 bool IsVisible(gfx::NativeView view) {
101 // MSVC complains if we don't include != 0. 105 // MSVC complains if we don't include != 0.
102 return ::IsWindowVisible(view) != 0; 106 return ::IsWindowVisible(view) != 0;
103 } 107 }
104 108
105 } // namespace platform_util 109 } // namespace platform_util
OLDNEW
« no previous file with comments | « chrome/common/platform_util_mac.mm ('k') | chrome/common/win_safe_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698