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

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

Issue 6825055: Include base/win/scoped_comptr.h instead of base/scoped_comptr_win.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert bad indentation, rebase Created 9 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) 2006-2008 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 <shlobj.h> 5 #include <shlobj.h>
6 #include <shobjidl.h> 6 #include <shobjidl.h>
7 7
8 #include "chrome/common/win_safe_util.h" 8 #include "chrome/common/win_safe_util.h"
9 9
10 #include "app/win/shell.h" 10 #include "app/win/shell.h"
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/scoped_comptr_win.h"
15 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/win/scoped_comptr.h"
16 16
17 namespace win_util { 17 namespace win_util {
18 18
19 // This function implementation is based on the attachment execution 19 // This function implementation is based on the attachment execution
20 // services functionally deployed with IE6 or Service pack 2. This 20 // services functionally deployed with IE6 or Service pack 2. This
21 // functionality is exposed in the IAttachmentExecute COM interface. 21 // functionality is exposed in the IAttachmentExecute COM interface.
22 // more information at: 22 // more information at:
23 // http://msdn2.microsoft.com/en-us/library/ms647048.aspx 23 // http://msdn2.microsoft.com/en-us/library/ms647048.aspx
24 bool SaferOpenItemViaShell(HWND hwnd, const std::wstring& window_title, 24 bool SaferOpenItemViaShell(HWND hwnd, const std::wstring& window_title,
25 const FilePath& full_path, 25 const FilePath& full_path,
26 const std::wstring& source_url) { 26 const std::wstring& source_url) {
27 ScopedComPtr<IAttachmentExecute> attachment_services; 27 base::win::ScopedComPtr<IAttachmentExecute> attachment_services;
28 HRESULT hr = attachment_services.CreateInstance(CLSID_AttachmentServices); 28 HRESULT hr = attachment_services.CreateInstance(CLSID_AttachmentServices);
29 if (FAILED(hr)) { 29 if (FAILED(hr)) {
30 // We don't have Attachment Execution Services, it must be a pre-XP.SP2 30 // We don't have Attachment Execution Services, it must be a pre-XP.SP2
31 // Windows installation, or the thread does not have COM initialized. 31 // Windows installation, or the thread does not have COM initialized.
32 if (hr == CO_E_NOTINITIALIZED) { 32 if (hr == CO_E_NOTINITIALIZED) {
33 NOTREACHED(); 33 NOTREACHED();
34 return false; 34 return false;
35 } 35 }
36 return app::win::OpenItemViaShell(full_path); 36 return app::win::OpenItemViaShell(full_path);
37 } 37 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 if (!result || !flush_result || written != kIdentifierSize) { 104 if (!result || !flush_result || written != kIdentifierSize) {
105 NOTREACHED(); 105 NOTREACHED();
106 return false; 106 return false;
107 } 107 }
108 108
109 return true; 109 return true;
110 } 110 }
111 111
112 } // namespace win_util 112 } // namespace win_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/shell_dialogs_win.cc ('k') | chrome/installer/util/shell_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698