summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/ntp/ntp_login_handler.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-28 19:56:49 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-28 19:56:49 +0000
commit7c5c6f3a41d42a5c795ff2af7cdbc608a2bd9d2e (patch)
tree6150b7af082e346fff367c72cae1e1ea552ca0bb /chrome/browser/ui/webui/ntp/ntp_login_handler.h
parent1d9b33d9640fb304cc8680d4f2546e2c8b68fe69 (diff)
downloadchromium_src-7c5c6f3a41d42a5c795ff2af7cdbc608a2bd9d2e.zip
chromium_src-7c5c6f3a41d42a5c795ff2af7cdbc608a2bd9d2e.tar.gz
chromium_src-7c5c6f3a41d42a5c795ff2af7cdbc608a2bd9d2e.tar.bz2
Move WebUI ntp files into new ntp directory.
And add myself to an ntp watchlist. BUG=none TEST=trybots Review URL: http://codereview.chromium.org/6905067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui/ntp/ntp_login_handler.h')
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_login_handler.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.h b/chrome/browser/ui/webui/ntp/ntp_login_handler.h
new file mode 100644
index 0000000..6245deb
--- /dev/null
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 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_UI_WEBUI_NTP_NTP_LOGIN_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_NTP_NTP_LOGIN_HANDLER_H_
+#pragma once
+
+#include "chrome/browser/prefs/pref_member.h"
+#include "content/browser/webui/web_ui.h"
+#include "content/common/notification_observer.h"
+
+// The NTP login handler currently simply displays the current logged in
+// username at the top of the NTP (and update itself when that changes).
+// In the future it may expand to allow users to login from the NTP.
+class NTPLoginHandler : public WebUIMessageHandler,
+ public NotificationObserver {
+ public:
+ NTPLoginHandler();
+ ~NTPLoginHandler();
+
+ virtual WebUIMessageHandler* Attach(WebUI* web_ui);
+
+ // WebUIMessageHandler interface
+ virtual void RegisterMessages();
+
+ // NotificationObserver interface
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ private:
+ // Called from JS when the NTP is loaded.
+ void HandleInitializeLogin(const ListValue* args);
+
+ // Internal helper method
+ void UpdateLogin();
+
+ StringPrefMember username_pref_;
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_LOGIN_HANDLER_H_