| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_PASSWORD_MANAGER_VIEW_H__ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_VIEW_H__ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_VIEW_H__ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_VIEW_H__ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/webdata/web_data_service.h" | 10 #include "chrome/browser/webdata/web_data_service.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 DISALLOW_EVIL_CONSTRUCTORS(PasswordManagerTableModel); | 83 DISALLOW_EVIL_CONSTRUCTORS(PasswordManagerTableModel); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 // A button that can have 2 different labels set on it and for which the | 86 // A button that can have 2 different labels set on it and for which the |
| 87 // preferred size is the size of the widest string. | 87 // preferred size is the size of the widest string. |
| 88 class MultiLabelButtons : public ChromeViews::NativeButton { | 88 class MultiLabelButtons : public ChromeViews::NativeButton { |
| 89 public: | 89 public: |
| 90 MultiLabelButtons(const std::wstring& label, const std::wstring& alt_label); | 90 MultiLabelButtons(const std::wstring& label, const std::wstring& alt_label); |
| 91 | 91 |
| 92 virtual void GetPreferredSize(CSize *out); | 92 virtual gfx::Size GetPreferredSize(); |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 std::wstring label_; | 95 std::wstring label_; |
| 96 std::wstring alt_label_; | 96 std::wstring alt_label_; |
| 97 CSize pref_size_; | 97 gfx::Size pref_size_; |
| 98 | 98 |
| 99 DISALLOW_EVIL_CONSTRUCTORS(MultiLabelButtons); | 99 DISALLOW_EVIL_CONSTRUCTORS(MultiLabelButtons); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 class PasswordManagerView : public ChromeViews::View, | 102 class PasswordManagerView : public ChromeViews::View, |
| 103 public ChromeViews::DialogDelegate, | 103 public ChromeViews::DialogDelegate, |
| 104 public ChromeViews::TableViewObserver, | 104 public ChromeViews::TableViewObserver, |
| 105 public ChromeViews::NativeButton::Listener { | 105 public ChromeViews::NativeButton::Listener { |
| 106 public: | 106 public: |
| 107 explicit PasswordManagerView(Profile* profile); | 107 explicit PasswordManagerView(Profile* profile); |
| 108 virtual ~PasswordManagerView(); | 108 virtual ~PasswordManagerView(); |
| 109 | 109 |
| 110 // Show the PasswordManagerContentView for the given profile. | 110 // Show the PasswordManagerContentView for the given profile. |
| 111 static void Show(Profile* profile); | 111 static void Show(Profile* profile); |
| 112 | 112 |
| 113 // View methods. | 113 // View methods. |
| 114 virtual void Layout(); | 114 virtual void Layout(); |
| 115 virtual void GetPreferredSize(CSize *out); | 115 virtual gfx::Size GetPreferredSize(); |
| 116 virtual void ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, | 116 virtual void ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, |
| 117 ChromeViews::View* child); | 117 ChromeViews::View* child); |
| 118 | 118 |
| 119 // ChromeViews::TableViewObserver implementation. | 119 // ChromeViews::TableViewObserver implementation. |
| 120 virtual void OnSelectionChanged(); | 120 virtual void OnSelectionChanged(); |
| 121 | 121 |
| 122 // NativeButton::Listener implementation. | 122 // NativeButton::Listener implementation. |
| 123 virtual void ButtonPressed(ChromeViews::NativeButton* sender); | 123 virtual void ButtonPressed(ChromeViews::NativeButton* sender); |
| 124 | 124 |
| 125 // ChromeViews::DialogDelegate methods: | 125 // ChromeViews::DialogDelegate methods: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 150 // The buttons and labels. | 150 // The buttons and labels. |
| 151 MultiLabelButtons show_button_; | 151 MultiLabelButtons show_button_; |
| 152 ChromeViews::NativeButton remove_button_; | 152 ChromeViews::NativeButton remove_button_; |
| 153 ChromeViews::NativeButton remove_all_button_; | 153 ChromeViews::NativeButton remove_all_button_; |
| 154 ChromeViews::Label password_label_; | 154 ChromeViews::Label password_label_; |
| 155 | 155 |
| 156 DISALLOW_EVIL_CONSTRUCTORS(PasswordManagerView); | 156 DISALLOW_EVIL_CONSTRUCTORS(PasswordManagerView); |
| 157 }; | 157 }; |
| 158 #endif // CHROME_BROWSER_PASSWORD_MANAGER_VIEW_H__ | 158 #endif // CHROME_BROWSER_PASSWORD_MANAGER_VIEW_H__ |
| 159 | 159 |
| OLD | NEW |