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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.cc

Issue 2847173004: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/ui/passwords/manage_passwords_ui_controller_mock.h" 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h"
6 6
7 #include "base/memory/ptr_util.h"
7 #include "components/password_manager/core/browser/password_form_manager.h" 8 #include "components/password_manager/core/browser/password_form_manager.h"
8 #include "components/password_manager/core/common/credential_manager_types.h" 9 #include "components/password_manager/core/common/credential_manager_types.h"
9 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
10 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock( 14 ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock(
14 content::WebContents* contents) 15 content::WebContents* contents)
15 : ManagePasswordsUIController(contents) { 16 : ManagePasswordsUIController(contents) {
16 // Do not silently replace an existing ManagePasswordsUIController because it 17 // Do not silently replace an existing ManagePasswordsUIController because it
17 // unregisters itself in WebContentsDestroyed(). 18 // unregisters itself in WebContentsDestroyed().
18 EXPECT_FALSE(contents->GetUserData(UserDataKey())); 19 EXPECT_FALSE(contents->GetUserData(UserDataKey()));
19 contents->SetUserData(UserDataKey(), this); 20 contents->SetUserData(UserDataKey(), base::WrapUnique(this));
20 } 21 }
21 22
22 ManagePasswordsUIControllerMock::~ManagePasswordsUIControllerMock() {} 23 ManagePasswordsUIControllerMock::~ManagePasswordsUIControllerMock() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698