| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #import "ios/chrome/browser/passwords/password_controller.h" | 5 #import "ios/chrome/browser/passwords/password_controller.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 // Creates PasswordController with the given |web_state| and a mock client | 84 // Creates PasswordController with the given |web_state| and a mock client |
| 85 // using the given |store|. If not null, |weak_client| is filled with a | 85 // using the given |store|. If not null, |weak_client| is filled with a |
| 86 // non-owning pointer to the created client. The created controller is | 86 // non-owning pointer to the created client. The created controller is |
| 87 // returned. | 87 // returned. |
| 88 base::scoped_nsobject<PasswordController> CreatePasswordController( | 88 base::scoped_nsobject<PasswordController> CreatePasswordController( |
| 89 web::WebState* web_state, | 89 web::WebState* web_state, |
| 90 password_manager::PasswordStore* store, | 90 password_manager::PasswordStore* store, |
| 91 MockPasswordManagerClient** weak_client) { | 91 MockPasswordManagerClient** weak_client) { |
| 92 auto client = base::WrapUnique(new MockPasswordManagerClient(store)); | 92 auto client = base::MakeUnique<MockPasswordManagerClient>(store); |
| 93 if (weak_client) | 93 if (weak_client) |
| 94 *weak_client = client.get(); | 94 *weak_client = client.get(); |
| 95 return base::scoped_nsobject<PasswordController>([[PasswordController alloc] | 95 return base::scoped_nsobject<PasswordController>([[PasswordController alloc] |
| 96 initWithWebState:web_state | 96 initWithWebState:web_state |
| 97 passwordsUiDelegate:nil | 97 passwordsUiDelegate:nil |
| 98 client:std::move(client)]); | 98 client:std::move(client)]); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace | 101 } // namespace |
| 102 | 102 |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 LogSavePasswordProgress(testing::Ne( | 1285 LogSavePasswordProgress(testing::Ne( |
| 1286 "Message: \"PasswordManager::OnPasswordFormsRendered\"\n"))) | 1286 "Message: \"PasswordManager::OnPasswordFormsRendered\"\n"))) |
| 1287 .Times(testing::AnyNumber()); | 1287 .Times(testing::AnyNumber()); |
| 1288 EXPECT_CALL(*weak_client, GetLogManager()) | 1288 EXPECT_CALL(*weak_client, GetLogManager()) |
| 1289 .WillRepeatedly(Return(&log_manager)); | 1289 .WillRepeatedly(Return(&log_manager)); |
| 1290 | 1290 |
| 1291 web_state.SetContentIsHTML(false); | 1291 web_state.SetContentIsHTML(false); |
| 1292 web_state.SetCurrentURL(GURL("https://example.com")); | 1292 web_state.SetCurrentURL(GURL("https://example.com")); |
| 1293 [passwordController webStateDidLoadPage:&web_state]; | 1293 [passwordController webStateDidLoadPage:&web_state]; |
| 1294 } | 1294 } |
| OLD | NEW |