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

Unified Diff: chrome/browser/views/password_manager_exceptions_view.h

Issue 18494: Added a dialog for removing exceptions of password manager (Closed)
Patch Set: style nit Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/views/password_manager_exceptions_view.h
diff --git a/chrome/browser/views/password_manager_exceptions_view.h b/chrome/browser/views/password_manager_exceptions_view.h
new file mode 100755
index 0000000000000000000000000000000000000000..1ae684c8f1922322f8ff44c73f5bddc1f5471913
--- /dev/null
+++ b/chrome/browser/views/password_manager_exceptions_view.h
@@ -0,0 +1,93 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PASSWORD_MANAGER_EXCEPTIONS_VIEW_H__
+#define CHROME_BROWSER_PASSWORD_MANAGER_EXCEPTIONS_VIEW_H__
+
+#include <vector>
+
+#include "base/scoped_ptr.h"
+#include "chrome/browser/views/password_manager_view.h"
+#include "chrome/browser/webdata/web_data_service.h"
+#include "chrome/common/stl_util-inl.h"
+#include "chrome/common/gfx/text_elider.h"
+#include "chrome/views/dialog_delegate.h"
+#include "chrome/views/label.h"
+#include "chrome/views/native_button.h"
+#include "chrome/views/table_view.h"
+#include "chrome/views/window.h"
+#include "webkit/glue/password_form.h"
+
+class PasswordManagerExceptionsTableModel : public PasswordManagerTableModel {
+ public:
+ explicit PasswordManagerExceptionsTableModel(Profile* profile);
+ virtual ~PasswordManagerExceptionsTableModel();
+
+ // TableModel methods.
+ virtual std::wstring GetText(int row, int column);
+ virtual int CompareValues(int row1, int row2, int col_id);
+
+ // WebDataServiceConsumer implementation.
+ virtual void OnWebDataServiceRequestDone(WebDataService::Handle h,
+ const WDTypedResult* result);
+ // Request all logins data.
+ void GetAllExceptionsForProfile();
+};
+
+class PasswordManagerExceptionsView : public views::View,
+ public views::DialogDelegate,
+ public views::TableViewObserver,
+ public views::NativeButton::Listener {
+ public:
+ explicit PasswordManagerExceptionsView(Profile* profile);
+ virtual ~PasswordManagerExceptionsView();
+
+ // Show the PasswordManagerExceptionsView for the given profile.
+ static void Show(Profile* profile);
+
+ // View methods.
+ virtual void Layout();
+ virtual gfx::Size GetPreferredSize();
+ virtual void ViewHierarchyChanged(bool is_add, views::View* parent,
+ views::View* child);
+
+ // views::TableViewObserver implementation.
+ virtual void OnSelectionChanged();
+
+ // NativeButton::Listener implementation.
+ virtual void ButtonPressed(views::NativeButton* sender);
+
+ // views::DialogDelegate methods:
+ virtual int GetDialogButtons() const;
+ virtual bool CanResize() const { return true; }
+ virtual bool CanMaximize() const { return false; }
+ virtual bool IsAlwaysOnTop() const { return false; }
+ virtual bool HasAlwaysOnTopMenu() const { return false; }
+ virtual std::wstring GetWindowTitle() const;
+ virtual void WindowClosing();
+ virtual views::View* GetContentsView();
+
+ private:
+ // Wire up buttons, the model, and the table view, and query the DB for
+ // exception data tied to the given profile.
+ void Init();
+
+ // Helper to configure our buttons and labels.
+ void SetupButtons();
+
+ // Helper to configure our table view.
+ void SetupTable();
+
+ // Components in this view.
+ PasswordManagerExceptionsTableModel table_model_;
+ views::TableView* table_view_;
+
+ // The buttons and labels.
+ views::NativeButton remove_button_;
+ views::NativeButton remove_all_button_;
+
+ DISALLOW_EVIL_CONSTRUCTORS(PasswordManagerExceptionsView);
+};
+#endif // CHROME_BROWSER_PASSWORD_MANAGER_EXCEPTIONS_VIEW_H__
+
« no previous file with comments | « chrome/browser/views/options/content_page_view.cc ('k') | chrome/browser/views/password_manager_exceptions_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698