From f6648a0d4d9b31c2aa4fc9b9abc0ef6f7fd03a68 Mon Sep 17 00:00:00 2001 From: Aleksei Kuzmin Date: Wed, 18 Apr 2018 19:20:15 +0200 Subject: [PATCH] Remove ScopedComPtr and scoped_comptr.h https://chromium-review.googlesource.com/726461 --- atom/browser/native_window_views.cc | 3 ++- atom/browser/ui/win/taskbar_host.h | 4 ++-- atom/common/platform_util_win.cc | 10 +++++----- chromium_src/chrome/browser/speech/tts_win.cc | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index e174c362af..a74cc8875e 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -6,6 +6,7 @@ #if defined(OS_WIN) #include +#include #endif #include @@ -741,7 +742,7 @@ void NativeWindowViews::FlashFrame(bool flash) { void NativeWindowViews::SetSkipTaskbar(bool skip) { #if defined(OS_WIN) - base::win::ScopedComPtr taskbar; + Microsoft::WRL::ComPtr taskbar; if (FAILED(::CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&taskbar))) || diff --git a/atom/browser/ui/win/taskbar_host.h b/atom/browser/ui/win/taskbar_host.h index eeed3ca10e..31199cf228 100644 --- a/atom/browser/ui/win/taskbar_host.h +++ b/atom/browser/ui/win/taskbar_host.h @@ -6,6 +6,7 @@ #define ATOM_BROWSER_UI_WIN_TASKBAR_HOST_H_ #include +#include #include #include @@ -13,7 +14,6 @@ #include "atom/browser/native_window.h" #include "base/callback.h" -#include "base/win/scoped_comptr.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/image/image.h" @@ -66,7 +66,7 @@ class TaskbarHost { std::vector last_buttons_; // The COM object of taskbar. - base::win::ScopedComPtr taskbar_; + Microsoft::WRL::ComPtr taskbar_; // Whether we have already added the buttons to thumbar. bool thumbar_buttons_added_ = false; diff --git a/atom/common/platform_util_win.cc b/atom/common/platform_util_win.cc index 947d3bc1a0..114672e5f8 100644 --- a/atom/common/platform_util_win.cc +++ b/atom/common/platform_util_win.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include "base/bind.h" #include "base/bind_helpers.h" @@ -24,7 +25,6 @@ #include "base/win/registry.h" #include "base/win/scoped_co_mem.h" #include "base/win/scoped_com_initializer.h" -#include "base/win/scoped_comptr.h" #include "base/win/windows_version.h" #include "ui/base/win/shell.h" #include "url/gurl.h" @@ -273,7 +273,7 @@ bool ShowItemInFolder(const base::FilePath& full_path) { return ui::win::OpenFolderViaShell(dir); } - base::win::ScopedComPtr desktop; + Microsoft::WRL::ComPtr desktop; HRESULT hr = SHGetDesktopFolder(desktop.GetAddressOf()); if (FAILED(hr)) return false; @@ -357,7 +357,7 @@ bool MoveItemToTrash(const base::FilePath& path) { if (!com_initializer.succeeded()) return false; - base::win::ScopedComPtr pfo; + Microsoft::WRL::ComPtr pfo; if (FAILED(::CoCreateInstance(CLSID_FileOperation, nullptr, CLSCTX_ALL, IID_PPV_ARGS(&pfo)))) return false; @@ -381,13 +381,13 @@ bool MoveItemToTrash(const base::FilePath& path) { } // Create an IShellItem from the supplied source path. - base::win::ScopedComPtr delete_item; + Microsoft::WRL::ComPtr delete_item; if (FAILED(SHCreateItemFromParsingName( path.value().c_str(), NULL, IID_PPV_ARGS(delete_item.GetAddressOf())))) return false; - base::win::ScopedComPtr delete_sink( + Microsoft::WRL::ComPtr delete_sink( new DeleteFileProgressSink); if (!delete_sink) return false; diff --git a/chromium_src/chrome/browser/speech/tts_win.cc b/chromium_src/chrome/browser/speech/tts_win.cc index efca61e339..3018cc14d5 100644 --- a/chromium_src/chrome/browser/speech/tts_win.cc +++ b/chromium_src/chrome/browser/speech/tts_win.cc @@ -5,12 +5,12 @@ #include #include #include +#include #include "base/memory/singleton.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" -#include "base/win/scoped_comptr.h" #include "chrome/browser/speech/tts_controller.h" #include "chrome/browser/speech/tts_platform.h" @@ -45,7 +45,7 @@ class TtsPlatformImplWin : public TtsPlatformImpl { void OnSpeechEvent(); - base::win::ScopedComPtr speech_synthesizer_; + Microsoft::WRL::ComPtr speech_synthesizer_; // These apply to the current utterance only. std::wstring utterance_;