| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_password_item_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_password_item_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 7 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
| 8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 class ManagePasswordItemView::ManageView : public views::View, | 108 class ManagePasswordItemView::ManageView : public views::View, |
| 109 public views::ButtonListener { | 109 public views::ButtonListener { |
| 110 public: | 110 public: |
| 111 explicit ManageView(ManagePasswordItemView* parent); | 111 explicit ManageView(ManagePasswordItemView* parent); |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 virtual ~ManageView(); | 114 virtual ~ManageView(); |
| 115 | 115 |
| 116 // views::ButtonListener: | 116 // views::ButtonListener: |
| 117 virtual void ButtonPressed(views::Button* sender, | 117 virtual void ButtonPressed(views::Button* sender, |
| 118 const ui::Event& event) OVERRIDE; | 118 const ui::Event& event) override; |
| 119 | 119 |
| 120 views::ImageButton* delete_button_; | 120 views::ImageButton* delete_button_; |
| 121 ManagePasswordItemView* parent_; | 121 ManagePasswordItemView* parent_; |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 ManagePasswordItemView::ManageView::ManageView(ManagePasswordItemView* parent) | 124 ManagePasswordItemView::ManageView::ManageView(ManagePasswordItemView* parent) |
| 125 : parent_(parent) { | 125 : parent_(parent) { |
| 126 views::GridLayout* layout = new views::GridLayout(this); | 126 views::GridLayout* layout = new views::GridLayout(this); |
| 127 SetLayoutManager(layout); | 127 SetLayoutManager(layout); |
| 128 | 128 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 157 // offer an undo link. | 157 // offer an undo link. |
| 158 class ManagePasswordItemView::UndoView : public views::View, | 158 class ManagePasswordItemView::UndoView : public views::View, |
| 159 public views::LinkListener { | 159 public views::LinkListener { |
| 160 public: | 160 public: |
| 161 explicit UndoView(ManagePasswordItemView* parent); | 161 explicit UndoView(ManagePasswordItemView* parent); |
| 162 | 162 |
| 163 private: | 163 private: |
| 164 virtual ~UndoView(); | 164 virtual ~UndoView(); |
| 165 | 165 |
| 166 // views::LinkListener: | 166 // views::LinkListener: |
| 167 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 167 virtual void LinkClicked(views::Link* source, int event_flags) override; |
| 168 | 168 |
| 169 views::Link* undo_link_; | 169 views::Link* undo_link_; |
| 170 ManagePasswordItemView* parent_; | 170 ManagePasswordItemView* parent_; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 ManagePasswordItemView::UndoView::UndoView(ManagePasswordItemView* parent) | 173 ManagePasswordItemView::UndoView::UndoView(ManagePasswordItemView* parent) |
| 174 : parent_(parent) { | 174 : parent_(parent) { |
| 175 views::GridLayout* layout = new views::GridLayout(this); | 175 views::GridLayout* layout = new views::GridLayout(this); |
| 176 SetLayoutManager(layout); | 176 SetLayoutManager(layout); |
| 177 | 177 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 AddChildView(new ManageView(this)); | 259 AddChildView(new ManageView(this)); |
| 260 GetLayoutManager()->Layout(this); | 260 GetLayoutManager()->Layout(this); |
| 261 | 261 |
| 262 // After the view is consistent, notify the model that the password needs to | 262 // After the view is consistent, notify the model that the password needs to |
| 263 // be updated (either removed or put back into the store, as appropriate. | 263 // be updated (either removed or put back into the store, as appropriate. |
| 264 model_->OnPasswordAction(password_form_, | 264 model_->OnPasswordAction(password_form_, |
| 265 delete_password_ | 265 delete_password_ |
| 266 ? ManagePasswordsBubbleModel::REMOVE_PASSWORD | 266 ? ManagePasswordsBubbleModel::REMOVE_PASSWORD |
| 267 : ManagePasswordsBubbleModel::ADD_PASSWORD); | 267 : ManagePasswordsBubbleModel::ADD_PASSWORD); |
| 268 } | 268 } |
| OLD | NEW |