OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_VIEWS_OPTIONS_EXCEPTIONS_PAGE_VIEW_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_OPTIONS_EXCEPTIONS_PAGE_VIEW_H_ | |
7 #pragma once | |
8 | |
9 #include <vector> | |
10 | |
11 #include "base/compiler_specific.h" | |
12 #include "chrome/browser/ui/views/options/options_page_view.h" | |
13 #include "chrome/browser/ui/views/options/passwords_page_view.h" | |
14 #include "views/controls/table/table_view_observer.h" | |
15 | |
16 class Profile; | |
17 | |
18 /////////////////////////////////////////////////////////////////////////////// | |
19 // ExceptionsTableModel | |
20 class ExceptionsTableModel : public PasswordsTableModel { | |
21 public: | |
22 explicit ExceptionsTableModel(Profile* profile); | |
23 virtual ~ExceptionsTableModel(); | |
24 | |
25 // TableModel methods. | |
26 virtual string16 GetText(int row, int column) OVERRIDE; | |
27 virtual int CompareValues(int row1, int row2, int col_id) OVERRIDE; | |
28 | |
29 // PasswordStoreConsumer implementation. | |
30 virtual void OnPasswordStoreRequestDone( | |
31 int handle, const std::vector<webkit_glue::PasswordForm*>& result); | |
32 // Request all logins data. | |
33 void GetAllExceptionsForProfile(); | |
34 }; | |
35 | |
36 /////////////////////////////////////////////////////////////////////////////// | |
37 // ExceptionsPageView | |
38 class ExceptionsPageView : public OptionsPageView, | |
39 public views::TableViewObserver, | |
40 public views::ButtonListener, | |
41 public PasswordsTableModelObserver { | |
42 public: | |
43 explicit ExceptionsPageView(Profile* profile); | |
44 virtual ~ExceptionsPageView(); | |
45 | |
46 // views::TableViewObserverImplementation. | |
47 virtual void OnSelectionChanged(); | |
48 | |
49 // views::ButtonListener implementation. | |
50 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | |
51 | |
52 // PasswordsTableModelObserver implementation. | |
53 virtual void OnRowCountChanged(size_t rows); | |
54 | |
55 protected: | |
56 virtual void InitControlLayout(); | |
57 | |
58 private: | |
59 // Helper to configure our buttons and labels. | |
60 void SetupButtons(); | |
61 | |
62 // Helper to configure our table view. | |
63 void SetupTable(); | |
64 | |
65 ExceptionsTableModel table_model_; | |
66 views::TableView* table_view_; | |
67 | |
68 // The buttons and labels. | |
69 views::NativeButton remove_button_; | |
70 views::NativeButton remove_all_button_; | |
71 MultiLabelButtons show_button_; | |
72 | |
73 DISALLOW_COPY_AND_ASSIGN(ExceptionsPageView); | |
74 }; | |
75 | |
76 #endif // CHROME_BROWSER_UI_VIEWS_OPTIONS_EXCEPTIONS_PAGE_VIEW_H_ | |
OLD | NEW |