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

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

Issue 209613002: Download shelf autohides on showing in shell, just same as regular open Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added browser and unit tests. Renamed 'UserActed' to 'OpenedOrShown'. Created 4 years, 1 month 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
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 SW_SHOWNORMAL)) <= 32) { 154 SW_SHOWNORMAL)) <= 32) {
155 // We fail to execute the call. We could display a message to the user. 155 // We fail to execute the call. We could display a message to the user.
156 // TODO(nsylvain): we should also add a dialog to warn on errors. See 156 // TODO(nsylvain): we should also add a dialog to warn on errors. See
157 // bug 1136923. 157 // bug 1136923.
158 return; 158 return;
159 } 159 }
160 } 160 }
161 161
162 } // namespace 162 } // namespace
163 163
164 void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { 164 namespace internal {
165
166 void PlatformShowItemInFolder(Profile* profile,
167 const base::FilePath& full_path) {
165 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 168 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
166 base::Bind(&ShowItemInFolderOnFileThread, full_path)); 169 base::Bind(&ShowItemInFolderOnFileThread, full_path));
167 } 170 }
168 171
169 namespace internal {
170
171 void PlatformOpenVerifiedItem(const base::FilePath& path, OpenItemType type) { 172 void PlatformOpenVerifiedItem(const base::FilePath& path, OpenItemType type) {
172 switch (type) { 173 switch (type) {
173 case OPEN_FILE: 174 case OPEN_FILE:
174 ui::win::OpenFileViaShell(path); 175 ui::win::OpenFileViaShell(path);
175 break; 176 break;
176 177
177 case OPEN_FOLDER: 178 case OPEN_FOLDER:
178 ui::win::OpenFolderViaShell(path); 179 ui::win::OpenFolderViaShell(path);
179 break; 180 break;
180 } 181 }
181 } 182 }
182 183
183 } // namespace internal 184 } // namespace internal
184 185
185 void OpenExternal(Profile* profile, const GURL& url) { 186 void OpenExternal(Profile* profile, const GURL& url) {
186 DCHECK_CURRENTLY_ON(BrowserThread::UI); 187 DCHECK_CURRENTLY_ON(BrowserThread::UI);
187 188
188 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 189 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
189 base::Bind(&OpenExternalOnFileThread, url)); 190 base::Bind(&OpenExternalOnFileThread, url));
190 } 191 }
191 192
192 } // namespace platform_util 193 } // namespace platform_util
OLDNEW
« no previous file with comments | « chrome/browser/platform_util_mac.mm ('k') | chrome/browser/ui/cocoa/download/download_item_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698