| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_VIEWS_OPTIONS_PASSWORDS_PAGE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_OPTIONS_PASSWORDS_PAGE_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_OPTIONS_PASSWORDS_PAGE_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_OPTIONS_PASSWORDS_PAGE_VIEW_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/gfx/text_elider.h" | 10 #include "app/gfx/text_elider.h" |
| 11 #include "app/table_model.h" | 11 #include "app/table_model.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/stl_util-inl.h" | 13 #include "base/stl_util-inl.h" |
| 14 #include "chrome/browser/password_manager/password_store.h" |
| 15 #include "chrome/browser/views/confirm_message_box_dialog.h" |
| 14 #include "chrome/browser/views/options/options_page_view.h" | 16 #include "chrome/browser/views/options/options_page_view.h" |
| 15 #include "chrome/browser/password_manager/password_store.h" | |
| 16 #include "views/controls/button/native_button.h" | 17 #include "views/controls/button/native_button.h" |
| 17 #include "views/controls/label.h" | 18 #include "views/controls/label.h" |
| 18 #include "views/controls/table/table_view.h" | 19 #include "views/controls/table/table_view.h" |
| 19 #include "views/controls/table/table_view_observer.h" | 20 #include "views/controls/table/table_view_observer.h" |
| 20 #include "views/window/dialog_delegate.h" | 21 #include "views/window/dialog_delegate.h" |
| 21 #include "views/window/window.h" | 22 #include "views/window/window.h" |
| 22 #include "webkit/glue/password_form.h" | 23 #include "webkit/glue/password_form.h" |
| 23 | 24 |
| 24 class Profile; | 25 class Profile; |
| 25 | 26 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void CancelLoginsQuery(); | 139 void CancelLoginsQuery(); |
| 139 | 140 |
| 140 DISALLOW_COPY_AND_ASSIGN(PasswordsTableModel); | 141 DISALLOW_COPY_AND_ASSIGN(PasswordsTableModel); |
| 141 }; | 142 }; |
| 142 | 143 |
| 143 /////////////////////////////////////////////////////////////////////////////// | 144 /////////////////////////////////////////////////////////////////////////////// |
| 144 // PasswordsPageView | 145 // PasswordsPageView |
| 145 class PasswordsPageView : public OptionsPageView, | 146 class PasswordsPageView : public OptionsPageView, |
| 146 public views::TableViewObserver, | 147 public views::TableViewObserver, |
| 147 public views::ButtonListener, | 148 public views::ButtonListener, |
| 148 public PasswordsTableModelObserver { | 149 public PasswordsTableModelObserver, |
| 150 public ConfirmMessageBoxObserver { |
| 149 public: | 151 public: |
| 150 explicit PasswordsPageView(Profile* profile); | 152 explicit PasswordsPageView(Profile* profile); |
| 151 | 153 |
| 152 // views::TableViewObserverImplementation. | 154 // views::TableViewObserverImplementation. |
| 153 virtual void OnSelectionChanged(); | 155 virtual void OnSelectionChanged(); |
| 154 | 156 |
| 155 // views::ButtonListener implementation. | 157 // views::ButtonListener implementation. |
| 156 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 158 virtual void ButtonPressed(views::Button* sender, const views::Event& event); |
| 157 | 159 |
| 158 // PasswordsTableModelObserver implementation. | 160 // PasswordsTableModelObserver implementation. |
| 159 virtual void OnRowCountChanged(size_t rows); | 161 virtual void OnRowCountChanged(size_t rows); |
| 160 | 162 |
| 163 // ConfirmMessageBoxObserver implementation. |
| 164 virtual void OnConfirmMessageAccept(); |
| 165 |
| 161 protected: | 166 protected: |
| 162 virtual void InitControlLayout(); | 167 virtual void InitControlLayout(); |
| 163 | 168 |
| 164 private: | 169 private: |
| 165 // Helper to configure our buttons and labels. | 170 // Helper to configure our buttons and labels. |
| 166 void SetupButtonsAndLabels(); | 171 void SetupButtonsAndLabels(); |
| 167 | 172 |
| 168 // Helper to configure our table view. | 173 // Helper to configure our table view. |
| 169 void SetupTable(); | 174 void SetupTable(); |
| 170 | 175 |
| 171 PasswordsTableModel table_model_; | 176 PasswordsTableModel table_model_; |
| 172 views::TableView* table_view_; | 177 views::TableView* table_view_; |
| 173 | 178 |
| 174 // The buttons and labels. | 179 // The buttons and labels. |
| 175 MultiLabelButtons show_button_; | 180 MultiLabelButtons show_button_; |
| 176 views::NativeButton remove_button_; | 181 views::NativeButton remove_button_; |
| 177 views::NativeButton remove_all_button_; | 182 views::NativeButton remove_all_button_; |
| 178 views::Label password_label_; | 183 views::Label password_label_; |
| 179 webkit_glue::PasswordForm* current_selected_password_; | 184 webkit_glue::PasswordForm* current_selected_password_; |
| 180 | 185 |
| 181 DISALLOW_COPY_AND_ASSIGN(PasswordsPageView); | 186 DISALLOW_COPY_AND_ASSIGN(PasswordsPageView); |
| 182 }; | 187 }; |
| 183 | 188 |
| 184 #endif // CHROME_BROWSER_VIEWS_OPTIONS_PASSWORDS_PAGE_VIEW_H_ | 189 #endif // CHROME_BROWSER_VIEWS_OPTIONS_PASSWORDS_PAGE_VIEW_H_ |
| OLD | NEW |