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

Unified Diff: chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc
diff --git a/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc b/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc
index 8ca91bed1325ed94af76cb0f06e05b441c02258e..a0b9d8b6fe011bb6a4b999ed268ca9440ec69e37 100644
--- a/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc
+++ b/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc
@@ -2,16 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/views/status_icons/status_tray_state_changer_win.h"
-
+#include <memory>
#include <utility>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/win/scoped_com_initializer.h"
#include "base/win/windows_version.h"
#include "chrome/browser/status_icons/status_icon.h"
#include "chrome/browser/ui/views/status_icons/status_icon_win.h"
+#include "chrome/browser/ui/views/status_icons/status_tray_state_changer_win.h"
#include "chrome/browser/ui/views/status_icons/status_tray_win.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -49,12 +48,12 @@ class StatusTrayStateChangerWinTest : public testing::Test {
HWND icon_window() { return status_icon_win_->window(); }
UINT icon_id() { return status_icon_win_->icon_id(); }
- scoped_ptr<NOTIFYITEM> SetupAndGetCurrentNotifyItem() {
+ std::unique_ptr<NOTIFYITEM> SetupAndGetCurrentNotifyItem() {
EXPECT_TRUE(CallCreateTrayNotify());
EXPECT_TRUE(IsInterfaceKnown());
- scoped_ptr<NOTIFYITEM> notify_item = GetNotifyItem();
+ std::unique_ptr<NOTIFYITEM> notify_item = GetNotifyItem();
EXPECT_TRUE(notify_item.get() != NULL);
DCHECK_EQ(notify_item->hwnd, icon_window());
DCHECK_EQ(notify_item->id, icon_id());
@@ -69,16 +68,16 @@ class StatusTrayStateChangerWinTest : public testing::Test {
tray_watcher_->interface_version_;
}
- void SendNotifyItemUpdate(scoped_ptr<NOTIFYITEM> notify_item) {
+ void SendNotifyItemUpdate(std::unique_ptr<NOTIFYITEM> notify_item) {
tray_watcher_->SendNotifyItemUpdate(std::move(notify_item));
}
- scoped_ptr<NOTIFYITEM> GetNotifyItem() {
+ std::unique_ptr<NOTIFYITEM> GetNotifyItem() {
return tray_watcher_->RegisterCallback();
}
- scoped_ptr<base::win::ScopedCOMInitializer> com_;
- scoped_ptr<StatusTrayWin> status_tray_;
+ std::unique_ptr<base::win::ScopedCOMInitializer> com_;
+ std::unique_ptr<StatusTrayWin> status_tray_;
scoped_refptr<StatusTrayStateChangerWin> tray_watcher_;
StatusIconWin* status_icon_win_;
@@ -91,7 +90,7 @@ class StatusTrayStateChangerWinTest : public testing::Test {
TEST_F(StatusTrayStateChangerWinTest, DISABLED_Setup) {
// This tests the code path that will read the NOTIFYITEM data structure for
// use in future tests.
- scoped_ptr<NOTIFYITEM> notify_item = SetupAndGetCurrentNotifyItem();
+ std::unique_ptr<NOTIFYITEM> notify_item = SetupAndGetCurrentNotifyItem();
EXPECT_FALSE(notify_item.get() == NULL);
}
@@ -100,7 +99,7 @@ TEST_F(StatusTrayStateChangerWinTest, DISABLED_Setup) {
TEST_F(StatusTrayStateChangerWinTest, DISABLED_ComApiTest) {
// Setup code to read the current preference.
- scoped_ptr<NOTIFYITEM> notify_item = SetupAndGetCurrentNotifyItem();
+ std::unique_ptr<NOTIFYITEM> notify_item = SetupAndGetCurrentNotifyItem();
ASSERT_TRUE(notify_item.get() != NULL);
// Store the current pref.
@@ -108,7 +107,7 @@ TEST_F(StatusTrayStateChangerWinTest, DISABLED_ComApiTest) {
// Ensure that running our code will do something.
if (notify_item->preference != PREFERENCE_SHOW_WHEN_ACTIVE) {
- scoped_ptr<NOTIFYITEM> notify_item_copy(new NOTIFYITEM(*notify_item));
+ std::unique_ptr<NOTIFYITEM> notify_item_copy(new NOTIFYITEM(*notify_item));
notify_item_copy->preference = PREFERENCE_SHOW_WHEN_ACTIVE;
SendNotifyItemUpdate(std::move(notify_item_copy));
}
@@ -133,7 +132,7 @@ TEST_F(StatusTrayStateChangerWinTest, DISABLED_TraySizeApiTest) {
return;
// Used to reset operating system state afterwards.
- scoped_ptr<NOTIFYITEM> notify_item = SetupAndGetCurrentNotifyItem();
+ std::unique_ptr<NOTIFYITEM> notify_item = SetupAndGetCurrentNotifyItem();
// We can't actually run this test if we're already showing the icon.
if (notify_item->preference == PREFERENCE_SHOW_ALWAYS)
return;

Powered by Google App Engine
This is Rietveld 408576698