| 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_APP_LAUNCHER_LOGIN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_LOGIN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_LOGIN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_LOGIN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "content/public/browser/web_ui_message_handler.h" | 11 #include "content/public/browser/web_ui_message_handler.h" |
| 11 | 12 |
| 12 class Profile; | 13 class Profile; |
| 13 class ProfileInfoWatcher; | 14 class ProfileInfoWatcher; |
| 14 | 15 |
| 15 // The login handler currently simply displays the current logged in | 16 // The login handler currently simply displays the current logged in |
| 16 // username at the top of the NTP (and update itself when that changes). | 17 // username at the top of the NTP (and update itself when that changes). |
| 17 // In the future it may expand to allow users to login from the NTP. | 18 // In the future it may expand to allow users to login from the NTP. |
| 18 class AppLauncherLoginHandler : public content::WebUIMessageHandler { | 19 class AppLauncherLoginHandler : public content::WebUIMessageHandler { |
| 19 public: | 20 public: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // Called from JS when the user clicks on the advanced link the sync promo NTP | 59 // Called from JS when the user clicks on the advanced link the sync promo NTP |
| 59 // bubble. Use use this to navigate to the sync settings page. |args| is the | 60 // bubble. Use use this to navigate to the sync settings page. |args| is the |
| 60 // list of arguments passed from JS and should be an empty list. | 61 // list of arguments passed from JS and should be an empty list. |
| 61 void HandleShowAdvancedLoginUI(const base::ListValue* args); | 62 void HandleShowAdvancedLoginUI(const base::ListValue* args); |
| 62 | 63 |
| 63 // Internal helper method | 64 // Internal helper method |
| 64 void UpdateLogin(); | 65 void UpdateLogin(); |
| 65 | 66 |
| 66 // Watches this web UI's profile for info changes (e.g. authenticated username | 67 // Watches this web UI's profile for info changes (e.g. authenticated username |
| 67 // changes). | 68 // changes). |
| 68 scoped_ptr<ProfileInfoWatcher> profile_info_watcher_; | 69 std::unique_ptr<ProfileInfoWatcher> profile_info_watcher_; |
| 69 | 70 |
| 70 DISALLOW_COPY_AND_ASSIGN(AppLauncherLoginHandler); | 71 DISALLOW_COPY_AND_ASSIGN(AppLauncherLoginHandler); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 #endif // CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_LOGIN_HANDLER_H_ | 74 #endif // CHROME_BROWSER_UI_WEBUI_APP_LAUNCHER_LOGIN_HANDLER_H_ |
| OLD | NEW |