Remove ScopedComPtr and scoped_comptr.h

https://chromium-review.googlesource.com/726461
This commit is contained in:
Aleksei Kuzmin 2018-04-18 19:20:15 +02:00 committed by Samuel Attard
parent 82d204e932
commit f6648a0d4d
4 changed files with 11 additions and 10 deletions

View file

@ -6,6 +6,7 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include <objbase.h> #include <objbase.h>
#include <wrl/client.h>
#endif #endif
#include <vector> #include <vector>
@ -741,7 +742,7 @@ void NativeWindowViews::FlashFrame(bool flash) {
void NativeWindowViews::SetSkipTaskbar(bool skip) { void NativeWindowViews::SetSkipTaskbar(bool skip) {
#if defined(OS_WIN) #if defined(OS_WIN)
base::win::ScopedComPtr<ITaskbarList> taskbar; Microsoft::WRL::ComPtr<ITaskbarList> taskbar;
if (FAILED(::CoCreateInstance(CLSID_TaskbarList, nullptr, if (FAILED(::CoCreateInstance(CLSID_TaskbarList, nullptr,
CLSCTX_INPROC_SERVER, CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&taskbar))) || IID_PPV_ARGS(&taskbar))) ||

View file

@ -6,6 +6,7 @@
#define ATOM_BROWSER_UI_WIN_TASKBAR_HOST_H_ #define ATOM_BROWSER_UI_WIN_TASKBAR_HOST_H_
#include <shobjidl.h> #include <shobjidl.h>
#include <wrl/client.h>
#include <map> #include <map>
#include <string> #include <string>
@ -13,7 +14,6 @@
#include "atom/browser/native_window.h" #include "atom/browser/native_window.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/win/scoped_comptr.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
@ -66,7 +66,7 @@ class TaskbarHost {
std::vector<ThumbarButton> last_buttons_; std::vector<ThumbarButton> last_buttons_;
// The COM object of taskbar. // The COM object of taskbar.
base::win::ScopedComPtr<ITaskbarList3> taskbar_; Microsoft::WRL::ComPtr<ITaskbarList3> taskbar_;
// Whether we have already added the buttons to thumbar. // Whether we have already added the buttons to thumbar.
bool thumbar_buttons_added_ = false; bool thumbar_buttons_added_ = false;

View file

@ -13,6 +13,7 @@
#include <objbase.h> #include <objbase.h>
#include <shellapi.h> #include <shellapi.h>
#include <shlobj.h> #include <shlobj.h>
#include <wrl/client.h>
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
@ -24,7 +25,6 @@
#include "base/win/registry.h" #include "base/win/registry.h"
#include "base/win/scoped_co_mem.h" #include "base/win/scoped_co_mem.h"
#include "base/win/scoped_com_initializer.h" #include "base/win/scoped_com_initializer.h"
#include "base/win/scoped_comptr.h"
#include "base/win/windows_version.h" #include "base/win/windows_version.h"
#include "ui/base/win/shell.h" #include "ui/base/win/shell.h"
#include "url/gurl.h" #include "url/gurl.h"
@ -273,7 +273,7 @@ bool ShowItemInFolder(const base::FilePath& full_path) {
return ui::win::OpenFolderViaShell(dir); return ui::win::OpenFolderViaShell(dir);
} }
base::win::ScopedComPtr<IShellFolder> desktop; Microsoft::WRL::ComPtr<IShellFolder> desktop;
HRESULT hr = SHGetDesktopFolder(desktop.GetAddressOf()); HRESULT hr = SHGetDesktopFolder(desktop.GetAddressOf());
if (FAILED(hr)) if (FAILED(hr))
return false; return false;
@ -357,7 +357,7 @@ bool MoveItemToTrash(const base::FilePath& path) {
if (!com_initializer.succeeded()) if (!com_initializer.succeeded())
return false; return false;
base::win::ScopedComPtr<IFileOperation> pfo; Microsoft::WRL::ComPtr<IFileOperation> pfo;
if (FAILED(::CoCreateInstance(CLSID_FileOperation, nullptr, CLSCTX_ALL, if (FAILED(::CoCreateInstance(CLSID_FileOperation, nullptr, CLSCTX_ALL,
IID_PPV_ARGS(&pfo)))) IID_PPV_ARGS(&pfo))))
return false; return false;
@ -381,13 +381,13 @@ bool MoveItemToTrash(const base::FilePath& path) {
} }
// Create an IShellItem from the supplied source path. // Create an IShellItem from the supplied source path.
base::win::ScopedComPtr<IShellItem> delete_item; Microsoft::WRL::ComPtr<IShellItem> delete_item;
if (FAILED(SHCreateItemFromParsingName( if (FAILED(SHCreateItemFromParsingName(
path.value().c_str(), NULL, path.value().c_str(), NULL,
IID_PPV_ARGS(delete_item.GetAddressOf())))) IID_PPV_ARGS(delete_item.GetAddressOf()))))
return false; return false;
base::win::ScopedComPtr<IFileOperationProgressSink> delete_sink( Microsoft::WRL::ComPtr<IFileOperationProgressSink> delete_sink(
new DeleteFileProgressSink); new DeleteFileProgressSink);
if (!delete_sink) if (!delete_sink)
return false; return false;

View file

@ -5,12 +5,12 @@
#include <math.h> #include <math.h>
#include <objbase.h> #include <objbase.h>
#include <sapi.h> #include <sapi.h>
#include <wrl/client.h>
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/values.h" #include "base/values.h"
#include "base/win/scoped_comptr.h"
#include "chrome/browser/speech/tts_controller.h" #include "chrome/browser/speech/tts_controller.h"
#include "chrome/browser/speech/tts_platform.h" #include "chrome/browser/speech/tts_platform.h"
@ -45,7 +45,7 @@ class TtsPlatformImplWin : public TtsPlatformImpl {
void OnSpeechEvent(); void OnSpeechEvent();
base::win::ScopedComPtr<ISpVoice> speech_synthesizer_; Microsoft::WRL::ComPtr<ISpVoice> speech_synthesizer_;
// These apply to the current utterance only. // These apply to the current utterance only.
std::wstring utterance_; std::wstring utterance_;