Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: chrome/browser/views/password_manager_exceptions_view.h

Issue 39313: Fix a crash in PasswordManagerExceptionsView (Closed)
Patch Set: more comments Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/views/password_manager_exceptions_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_EXCEPTIONS_VIEW_H__ 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_EXCEPTIONS_VIEW_H__
6 #define CHROME_BROWSER_PASSWORD_MANAGER_EXCEPTIONS_VIEW_H__ 6 #define CHROME_BROWSER_PASSWORD_MANAGER_EXCEPTIONS_VIEW_H__
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 20 matching lines...) Expand all
31 // WebDataServiceConsumer implementation. 31 // WebDataServiceConsumer implementation.
32 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, 32 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h,
33 const WDTypedResult* result); 33 const WDTypedResult* result);
34 // Request all logins data. 34 // Request all logins data.
35 void GetAllExceptionsForProfile(); 35 void GetAllExceptionsForProfile();
36 }; 36 };
37 37
38 class PasswordManagerExceptionsView : public views::View, 38 class PasswordManagerExceptionsView : public views::View,
39 public views::DialogDelegate, 39 public views::DialogDelegate,
40 public views::TableViewObserver, 40 public views::TableViewObserver,
41 public views::NativeButton::Listener { 41 public views::NativeButton::Listener,
42 public PasswordManagerTableModelObserver {
42 public: 43 public:
43 explicit PasswordManagerExceptionsView(Profile* profile); 44 explicit PasswordManagerExceptionsView(Profile* profile);
44 virtual ~PasswordManagerExceptionsView(); 45 virtual ~PasswordManagerExceptionsView();
45 46
46 // Show the PasswordManagerExceptionsView for the given profile. 47 // Show the PasswordManagerExceptionsView for the given profile.
47 static void Show(Profile* profile); 48 static void Show(Profile* profile);
48 49
49 // View methods. 50 // View methods.
50 virtual void Layout(); 51 virtual void Layout();
51 virtual gfx::Size GetPreferredSize(); 52 virtual gfx::Size GetPreferredSize();
52 virtual void ViewHierarchyChanged(bool is_add, views::View* parent, 53 virtual void ViewHierarchyChanged(bool is_add, views::View* parent,
53 views::View* child); 54 views::View* child);
54 55
55 // views::TableViewObserver implementation. 56 // views::TableViewObserver implementation.
56 virtual void OnSelectionChanged(); 57 virtual void OnSelectionChanged();
57 58
58 // NativeButton::Listener implementation. 59 // NativeButton::Listener implementation.
59 virtual void ButtonPressed(views::NativeButton* sender); 60 virtual void ButtonPressed(views::NativeButton* sender);
60 61
61 // views::DialogDelegate methods: 62 // views::DialogDelegate methods:
62 virtual int GetDialogButtons() const; 63 virtual int GetDialogButtons() const;
63 virtual bool CanResize() const { return true; } 64 virtual bool CanResize() const { return true; }
64 virtual bool CanMaximize() const { return false; } 65 virtual bool CanMaximize() const { return false; }
65 virtual bool IsAlwaysOnTop() const { return false; } 66 virtual bool IsAlwaysOnTop() const { return false; }
66 virtual bool HasAlwaysOnTopMenu() const { return false; } 67 virtual bool HasAlwaysOnTopMenu() const { return false; }
67 virtual std::wstring GetWindowTitle() const; 68 virtual std::wstring GetWindowTitle() const;
68 virtual void WindowClosing(); 69 virtual void WindowClosing();
69 virtual views::View* GetContentsView(); 70 virtual views::View* GetContentsView();
70 71
72 // PasswordManagerTableModelObserver implementation.
73 virtual void OnRowCountChanged(size_t rows);
74
71 private: 75 private:
72 // Wire up buttons, the model, and the table view, and query the DB for 76 // Wire up buttons, the model, and the table view, and query the DB for
73 // exception data tied to the given profile. 77 // exception data tied to the given profile.
74 void Init(); 78 void Init();
75 79
76 // Helper to configure our buttons and labels. 80 // Helper to configure our buttons and labels.
77 void SetupButtons(); 81 void SetupButtons();
78 82
79 // Helper to configure our table view. 83 // Helper to configure our table view.
80 void SetupTable(); 84 void SetupTable();
81 85
82 // Components in this view. 86 // Components in this view.
83 PasswordManagerExceptionsTableModel table_model_; 87 PasswordManagerExceptionsTableModel table_model_;
84 views::TableView* table_view_; 88 views::TableView* table_view_;
85 89
86 // The buttons and labels. 90 // The buttons and labels.
87 views::NativeButton remove_button_; 91 views::NativeButton remove_button_;
88 views::NativeButton remove_all_button_; 92 views::NativeButton remove_all_button_;
89 93
94 static PasswordManagerExceptionsView* instance_;
95
90 DISALLOW_EVIL_CONSTRUCTORS(PasswordManagerExceptionsView); 96 DISALLOW_EVIL_CONSTRUCTORS(PasswordManagerExceptionsView);
91 }; 97 };
92 #endif // CHROME_BROWSER_PASSWORD_MANAGER_EXCEPTIONS_VIEW_H__ 98 #endif // CHROME_BROWSER_PASSWORD_MANAGER_EXCEPTIONS_VIEW_H__
93 99
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/views/password_manager_exceptions_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698