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

Side by Side Diff: chrome/test/base/test_browser_window_aura.cc

Issue 1551503002: Convert Pass()→std::move() in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/test/base/test_browser_window_aura.h" 5 #include "chrome/test/base/test_browser_window_aura.h"
6 6
7 #include <utility>
8
7 namespace chrome { 9 namespace chrome {
8 10
9 scoped_ptr<Browser> CreateBrowserWithAuraTestWindowForParams( 11 scoped_ptr<Browser> CreateBrowserWithAuraTestWindowForParams(
10 scoped_ptr<aura::Window> window, 12 scoped_ptr<aura::Window> window,
11 Browser::CreateParams* params) { 13 Browser::CreateParams* params) {
12 if (window.get() == nullptr) { 14 if (window.get() == nullptr) {
13 window.reset(new aura::Window(nullptr)); 15 window.reset(new aura::Window(nullptr));
14 window->set_id(0); 16 window->set_id(0);
15 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); 17 window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
16 window->Init(ui::LAYER_TEXTURED); 18 window->Init(ui::LAYER_TEXTURED);
17 window->Show(); 19 window->Show();
18 } 20 }
19 21
20 TestBrowserWindowAura* browser_window = 22 TestBrowserWindowAura* browser_window =
21 new TestBrowserWindowAura(window.Pass()); 23 new TestBrowserWindowAura(std::move(window));
22 new TestBrowserWindowOwner(browser_window); 24 new TestBrowserWindowOwner(browser_window);
23 return browser_window->CreateBrowser(params); 25 return browser_window->CreateBrowser(params);
24 } 26 }
25 27
26 } // namespace chrome 28 } // namespace chrome
27 29
28 TestBrowserWindowAura::TestBrowserWindowAura( 30 TestBrowserWindowAura::TestBrowserWindowAura(
29 scoped_ptr<aura::Window> native_window) 31 scoped_ptr<aura::Window> native_window)
30 : native_window_(native_window.Pass()) {} 32 : native_window_(std::move(native_window)) {}
31 33
32 TestBrowserWindowAura::~TestBrowserWindowAura() {} 34 TestBrowserWindowAura::~TestBrowserWindowAura() {}
33 35
34 gfx::NativeWindow TestBrowserWindowAura::GetNativeWindow() const { 36 gfx::NativeWindow TestBrowserWindowAura::GetNativeWindow() const {
35 return native_window_.get(); 37 return native_window_.get();
36 } 38 }
37 39
38 void TestBrowserWindowAura::Show() { 40 void TestBrowserWindowAura::Show() {
39 native_window_->Show(); 41 native_window_->Show();
40 } 42 }
41 43
42 void TestBrowserWindowAura::Hide() { 44 void TestBrowserWindowAura::Hide() {
43 native_window_->Hide(); 45 native_window_->Hide();
44 } 46 }
45 47
46 gfx::Rect TestBrowserWindowAura::GetBounds() const { 48 gfx::Rect TestBrowserWindowAura::GetBounds() const {
47 return native_window_->bounds(); 49 return native_window_->bounds();
48 } 50 }
49 51
50 scoped_ptr<Browser> TestBrowserWindowAura::CreateBrowser( 52 scoped_ptr<Browser> TestBrowserWindowAura::CreateBrowser(
51 Browser::CreateParams* params) { 53 Browser::CreateParams* params) {
52 params->window = this; 54 params->window = this;
53 browser_ = new Browser(*params); 55 browser_ = new Browser(*params);
54 return make_scoped_ptr(browser_); 56 return make_scoped_ptr(browser_);
55 } 57 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698