| OLD | NEW |
| 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/password_manager/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 // will cause multiple call of OnInputEvent. Since Widget API doesn't allow to | 385 // will cause multiple call of OnInputEvent. Since Widget API doesn't allow to |
| 386 // check whether the observer is already added, the observer is removed and | 386 // check whether the observer is already added, the observer is removed and |
| 387 // added again, to ensure that it is added only once. | 387 // added again, to ensure that it is added only once. |
| 388 web_contents()->GetRenderViewHost()->GetWidget()->RemoveInputEventObserver( | 388 web_contents()->GetRenderViewHost()->GetWidget()->RemoveInputEventObserver( |
| 389 this); | 389 this); |
| 390 web_contents()->GetRenderViewHost()->GetWidget()->AddInputEventObserver(this); | 390 web_contents()->GetRenderViewHost()->GetWidget()->AddInputEventObserver(this); |
| 391 } | 391 } |
| 392 | 392 |
| 393 void ChromePasswordManagerClient::OnInputEvent( | 393 void ChromePasswordManagerClient::OnInputEvent( |
| 394 const blink::WebInputEvent& event) { | 394 const blink::WebInputEvent& event) { |
| 395 if (event.type != blink::WebInputEvent::Char) | 395 if (event.type() != blink::WebInputEvent::Char) |
| 396 return; | 396 return; |
| 397 const blink::WebKeyboardEvent& key_event = | 397 const blink::WebKeyboardEvent& key_event = |
| 398 static_cast<const blink::WebKeyboardEvent&>(event); | 398 static_cast<const blink::WebKeyboardEvent&>(event); |
| 399 password_reuse_detection_manager_.OnKeyPressed(key_event.text); | 399 password_reuse_detection_manager_.OnKeyPressed(key_event.text); |
| 400 } | 400 } |
| 401 | 401 |
| 402 PrefService* ChromePasswordManagerClient::GetPrefs() { | 402 PrefService* ChromePasswordManagerClient::GetPrefs() { |
| 403 return profile_->GetPrefs(); | 403 return profile_->GetPrefs(); |
| 404 } | 404 } |
| 405 | 405 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 ChromePasswordManagerClient::FromWebContents(web_contents); | 635 ChromePasswordManagerClient::FromWebContents(web_contents); |
| 636 | 636 |
| 637 // Try to bind to the driver, but if driver is not available for this render | 637 // Try to bind to the driver, but if driver is not available for this render |
| 638 // frame host, the request will be just dropped. This will cause the message | 638 // frame host, the request will be just dropped. This will cause the message |
| 639 // pipe to be closed, which will raise a connection error on the peer side. | 639 // pipe to be closed, which will raise a connection error on the peer side. |
| 640 if (!instance) | 640 if (!instance) |
| 641 return; | 641 return; |
| 642 | 642 |
| 643 instance->credential_manager_impl_.BindRequest(std::move(request)); | 643 instance->credential_manager_impl_.BindRequest(std::move(request)); |
| 644 } | 644 } |
| OLD | NEW |