| OLD | NEW |
| 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/browser/ui/views/passwords/manage_credential_item_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_credential_item_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 8 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
| 9 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" | 9 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 ManagePasswordsBubbleModel* model, | 51 ManagePasswordsBubbleModel* model, |
| 52 const autofill::PasswordForm* password_form) | 52 const autofill::PasswordForm* password_form) |
| 53 : form_(password_form), | 53 : form_(password_form), |
| 54 delete_button_(nullptr), | 54 delete_button_(nullptr), |
| 55 undo_link_(nullptr), | 55 undo_link_(nullptr), |
| 56 model_(model), | 56 model_(model), |
| 57 form_deleted_(false) { | 57 form_deleted_(false) { |
| 58 net::URLRequestContextGetter* request_context = | 58 net::URLRequestContextGetter* request_context = |
| 59 model_->GetProfile()->GetRequestContext(); | 59 model_->GetProfile()->GetRequestContext(); |
| 60 credential_button_.reset(new CredentialsItemView( | 60 credential_button_.reset(new CredentialsItemView( |
| 61 this, form_, password_manager::CredentialType::CREDENTIAL_TYPE_LOCAL, | 61 this, form_, password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD, |
| 62 CredentialsItemView::ACCOUNT_CHOOSER, request_context)); | 62 CredentialsItemView::ACCOUNT_CHOOSER, request_context)); |
| 63 credential_button_->set_owned_by_client(); | 63 credential_button_->set_owned_by_client(); |
| 64 credential_button_->SetEnabled(false); | 64 credential_button_->SetEnabled(false); |
| 65 Refresh(); | 65 Refresh(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 ManageCredentialItemView::~ManageCredentialItemView() { | 68 ManageCredentialItemView::~ManageCredentialItemView() { |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ManageCredentialItemView::Refresh() { | 71 void ManageCredentialItemView::Refresh() { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 Refresh(); | 113 Refresh(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void ManageCredentialItemView::LinkClicked(views::Link* source, | 116 void ManageCredentialItemView::LinkClicked(views::Link* source, |
| 117 int event_flags) { | 117 int event_flags) { |
| 118 DCHECK_EQ(undo_link_, source); | 118 DCHECK_EQ(undo_link_, source); |
| 119 form_deleted_ = false; | 119 form_deleted_ = false; |
| 120 model_->OnPasswordAction(*form_, ManagePasswordsBubbleModel::ADD_PASSWORD); | 120 model_->OnPasswordAction(*form_, ManagePasswordsBubbleModel::ADD_PASSWORD); |
| 121 Refresh(); | 121 Refresh(); |
| 122 } | 122 } |
| OLD | NEW |