| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_WEBUI_NTP_NTP_LOGIN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NTP_LOGIN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NTP_LOGIN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NTP_LOGIN_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/prefs/pref_member.h" | 9 #include "chrome/browser/prefs/pref_member.h" |
| 10 #include "content/browser/webui/web_ui.h" | 10 #include "content/browser/webui/web_ui.h" |
| 11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" |
| 12 | 13 |
| 13 class Profile; | 14 class Profile; |
| 14 class Browser; | 15 class Browser; |
| 15 | 16 |
| 16 // The NTP login handler currently simply displays the current logged in | 17 // The NTP login handler currently simply displays the current logged in |
| 17 // username at the top of the NTP (and update itself when that changes). | 18 // username at the top of the NTP (and update itself when that changes). |
| 18 // In the future it may expand to allow users to login from the NTP. | 19 // In the future it may expand to allow users to login from the NTP. |
| 19 class NTPLoginHandler : public WebUIMessageHandler, | 20 class NTPLoginHandler : public WebUIMessageHandler, |
| 20 public content::NotificationObserver { | 21 public content::NotificationObserver { |
| 21 public: | 22 public: |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 66 |
| 66 // Called from JS when the user clicks on the advanced link the sync promo NTP | 67 // Called from JS when the user clicks on the advanced link the sync promo NTP |
| 67 // bubble. Use use this to navigate to the sync settings page. |args| is the | 68 // bubble. Use use this to navigate to the sync settings page. |args| is the |
| 68 // list of arguments passed from JS and should be an empty list. | 69 // list of arguments passed from JS and should be an empty list. |
| 69 void HandleShowAdvancedLoginUI(const ListValue* args); | 70 void HandleShowAdvancedLoginUI(const ListValue* args); |
| 70 | 71 |
| 71 // Internal helper method | 72 // Internal helper method |
| 72 void UpdateLogin(); | 73 void UpdateLogin(); |
| 73 | 74 |
| 74 StringPrefMember username_pref_; | 75 StringPrefMember username_pref_; |
| 76 content::NotificationRegistrar registrar_; |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_LOGIN_HANDLER_H_ | 79 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_LOGIN_HANDLER_H_ |
| OLD | NEW |