summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/password_dialog_view.h
diff options
context:
space:
mode:
authorchocobo@google.com <chocobo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 22:39:23 +0000
committerchocobo@google.com <chocobo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 22:39:23 +0000
commite9b2727fd53475a42d0fc1acd310d63641a544f6 (patch)
treee2ef5704760b69aa194761de7eecc61225c05abd /chrome/browser/chromeos/password_dialog_view.h
parentfaa604ed475fe52732041197d1218150fccd801c (diff)
downloadchromium_src-e9b2727fd53475a42d0fc1acd310d63641a544f6.zip
chromium_src-e9b2727fd53475a42d0fc1acd310d63641a544f6.tar.gz
chromium_src-e9b2727fd53475a42d0fc1acd310d63641a544f6.tar.bz2
Add wifi menu button to status bar of Chrome OS. Currently showing mock data as we have not hooked it up to ChromeOS shared library wifi code yet.
TEST=none BUG=23090 Review URL: http://codereview.chromium.org/231014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/password_dialog_view.h')
-rw-r--r--chrome/browser/chromeos/password_dialog_view.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/password_dialog_view.h b/chrome/browser/chromeos/password_dialog_view.h
new file mode 100644
index 0000000..04f7429
--- /dev/null
+++ b/chrome/browser/chromeos/password_dialog_view.h
@@ -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_