Index: chrome/browser/chromeos/password_dialog_view.h |
=================================================================== |
--- chrome/browser/chromeos/password_dialog_view.h (revision 0) |
+++ chrome/browser/chromeos/password_dialog_view.h (revision 0) |
@@ -0,0 +1,66 @@ |
+// 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_CHROMEOS_PASSWORD_DIALOG_VIEW_H_ |
+#define CHROME_BROWSER_CHROMEOS_PASSWORD_DIALOG_VIEW_H_ |
+ |
+#include "base/string16.h" |
+#include "views/window/dialog_delegate.h" |
+ |
+namespace views { |
+class Textfield; |
+class View; |
+class Window; |
+} |
+ |
+// Delegate implemented by caller of PasswordDialogView to handle the user |
+// interacting with the dialog box. |
+class PasswordDialogDelegate { |
+ public: |
+ // Called when user clicks on cancel button. |
+ // Return whether or not to allow password dialog to close. |
+ virtual bool OnPasswordDialogCancel() = 0; |
+ |
+ // Called when user clicks on ok with a password. |
+ // Return whether or not to allow password dialog to close. |
+ virtual bool OnPasswordDialogAccept(const string16& password) = 0; |
+}; |
+ |
+// A dialog box for showing a password textfield. |
+class PasswordDialogView : public views::View, |
+ public views::DialogDelegate { |
+ public: |
+ explicit PasswordDialogView(PasswordDialogDelegate* delegate); |
+ virtual ~PasswordDialogView() {} |
+ |
+ // views::DialogDelegate methods. |
+ virtual bool Cancel(); |
+ virtual bool Accept(); |
+ virtual std::wstring GetWindowTitle() const; |
+ |
+ // views::WindowDelegate method. |
+ virtual bool IsModal() const { return true; } |
+ virtual views::View* GetContentsView() { return this; } |
+ |
+ // views::View overrides. |
+ virtual void Layout(); |
+ virtual gfx::Size GetPreferredSize(); |
+ |
+ protected: |
+ virtual void ViewHierarchyChanged(bool is_add, views::View* parent, |
+ views::View* child); |
+ |
+ private: |
+ void Init(); |
+ |
+ // Used for call back to delegate that password has been entered. |
+ PasswordDialogDelegate* delegate_; |
+ |
+ // Combobox and its corresponding model. |
+ views::Textfield* password_textfield_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PasswordDialogView); |
+}; |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_PASSWORD_DIALOG_VIEW_H_ |
Property changes on: chrome/browser/chromeos/password_dialog_view.h |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |