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

Unified Diff: ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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: ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
diff --git a/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc b/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
index 46357f60f0093af2b1ee80265196eff9d348e21f..2bb919bb4dfa77189bdb2ba0206b7eab3caec192 100644
--- a/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
+++ b/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
@@ -4,11 +4,13 @@
#include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h"
-#include <stddef.h>
-#include <X11/extensions/shape.h>
#include <X11/Xlib.h>
#include <X11/Xregion.h>
+#include <X11/extensions/shape.h>
+#include <stddef.h>
+
#include <algorithm>
+#include <memory>
#include <vector>
// Get rid of X11 macros which conflict with gtest.
@@ -16,7 +18,6 @@
#undef None
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkRegion.h"
@@ -62,7 +63,7 @@ class MinimizeWaiter : public X11PropertyChangeWaiter {
return true;
}
- scoped_ptr<ui::X11AtomCache> atom_cache_;
+ std::unique_ptr<ui::X11AtomCache> atom_cache_;
DISALLOW_COPY_AND_ASSIGN(MinimizeWaiter);
};
@@ -118,8 +119,8 @@ class X11TopmostWindowFinderTest : public ViewsTestBase {
// Creates and shows a Widget with |bounds|. The caller takes ownership of
// the returned widget.
- scoped_ptr<Widget> CreateAndShowWidget(const gfx::Rect& bounds) {
- scoped_ptr<Widget> toplevel(new Widget);
+ std::unique_ptr<Widget> CreateAndShowWidget(const gfx::Rect& bounds) {
+ std::unique_ptr<Widget> toplevel(new Widget);
Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW);
params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.native_widget = new DesktopNativeWidgetAura(toplevel.get());
@@ -226,14 +227,14 @@ TEST_F(X11TopmostWindowFinderTest, Basic) {
// Avoid positioning test windows at 0x0 because window managers often have a
// panel/launcher along one of the screen edges and do not allow windows to
// position themselves to overlap the panel/launcher.
- scoped_ptr<Widget> widget1(
+ std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 200, 100)));
aura::Window* window1 = widget1->GetNativeWindow();
XID xid1 = window1->GetHost()->GetAcceleratedWidget();
XID xid2 = CreateAndShowXWindow(gfx::Rect(200, 100, 100, 200));
- scoped_ptr<Widget> widget3(
+ std::unique_ptr<Widget> widget3(
CreateAndShowWidget(gfx::Rect(100, 190, 200, 110)));
aura::Window* window3 = widget3->GetNativeWindow();
XID xid3 = window3->GetHost()->GetAcceleratedWidget();
@@ -277,7 +278,7 @@ TEST_F(X11TopmostWindowFinderTest, Basic) {
// Test that the minimized state is properly handled.
TEST_F(X11TopmostWindowFinderTest, Minimized) {
- scoped_ptr<Widget> widget1(
+ std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 100, 100)));
aura::Window* window1 = widget1->GetNativeWindow();
XID xid1 = window1->GetHost()->GetAcceleratedWidget();
@@ -316,7 +317,7 @@ TEST_F(X11TopmostWindowFinderTest, NonRectangular) {
if (!ui::IsShapeExtensionAvailable())
return;
- scoped_ptr<Widget> widget1(
+ std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 100, 100)));
XID xid1 = widget1->GetNativeWindow()->GetHost()->GetAcceleratedWidget();
SkRegion* skregion1 = new SkRegion;
@@ -356,7 +357,7 @@ TEST_F(X11TopmostWindowFinderTest, NonRectangularEmptyShape) {
if (!ui::IsShapeExtensionAvailable())
return;
- scoped_ptr<Widget> widget1(
+ std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 100, 100)));
XID xid1 = widget1->GetNativeWindow()->GetHost()->GetAcceleratedWidget();
SkRegion* skregion1 = new SkRegion;
@@ -377,7 +378,7 @@ TEST_F(X11TopmostWindowFinderTest, NonRectangularNullShape) {
if (!ui::IsShapeExtensionAvailable())
return;
- scoped_ptr<Widget> widget1(
+ std::unique_ptr<Widget> widget1(
CreateAndShowWidget(gfx::Rect(100, 100, 100, 100)));
XID xid1 = widget1->GetNativeWindow()->GetHost()->GetAcceleratedWidget();
SkRegion* skregion1 = new SkRegion;

Powered by Google App Engine
This is Rietveld 408576698