Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Side by Side Diff: chrome/browser/ui/webui/history_login_handler.h

Issue 2361513003: MD History: Update sign in state in data source (Closed)
Patch Set: add get method Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_HISTORY_LOGIN_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_HISTORY_LOGIN_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_HISTORY_LOGIN_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_HISTORY_LOGIN_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
Dan Beam 2016/09/30 00:47:43 base/callback_forward.h
lshang 2016/09/30 01:31:08 Done.
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "content/public/browser/web_ui_message_handler.h" 11 #include "content/public/browser/web_ui_message_handler.h"
12 12
13 class ProfileInfoWatcher; 13 class ProfileInfoWatcher;
14 14
15 namespace content {
16 class WebUIDataSource;
17 }
18
15 // The handler for login-related messages from chrome://history. 19 // The handler for login-related messages from chrome://history.
16 class HistoryLoginHandler : public content::WebUIMessageHandler { 20 class HistoryLoginHandler : public content::WebUIMessageHandler {
17 public: 21 public:
18 HistoryLoginHandler(); 22 explicit HistoryLoginHandler(
23 const base::Callback<void(bool)>& signin_callback);
19 ~HistoryLoginHandler() override; 24 ~HistoryLoginHandler() override;
20 25
21 // WebUIMessageHandler implementation. 26 // WebUIMessageHandler implementation.
22 void RegisterMessages() override; 27 void RegisterMessages() override;
23 28
24 private: 29 private:
25 // Handler for the "otherDevicesInitialized" message. No args. 30 // Handler for the "otherDevicesInitialized" message. No args.
26 void HandleOtherDevicesInitialized(const base::ListValue* args); 31 void HandleOtherDevicesInitialized(const base::ListValue* args);
27 32
28 // Handler for the "startSignInFlow" message. No args. 33 // Handler for the "startSignInFlow" message. No args.
29 void HandleStartSignInFlow(const base::ListValue* args); 34 void HandleStartSignInFlow(const base::ListValue* args);
30 35
31 // Called by |profile_info_watcher_| on desktop if profile info changes. 36 // Called by |profile_info_watcher_| on desktop if profile info changes.
32 void ProfileInfoChanged(); 37 void ProfileInfoChanged();
33 38
34 // Watches this web UI's profile for info changes (e.g. authenticated username 39 // Watches this web UI's profile for info changes (e.g. authenticated username
35 // changes). 40 // changes).
36 std::unique_ptr<ProfileInfoWatcher> profile_info_watcher_; 41 std::unique_ptr<ProfileInfoWatcher> profile_info_watcher_;
37 42
43 base::Callback<void(bool)> signin_callback_;
44
38 DISALLOW_COPY_AND_ASSIGN(HistoryLoginHandler); 45 DISALLOW_COPY_AND_ASSIGN(HistoryLoginHandler);
39 }; 46 };
40 47
41 #endif // CHROME_BROWSER_UI_WEBUI_HISTORY_LOGIN_HANDLER_H_ 48 #endif // CHROME_BROWSER_UI_WEBUI_HISTORY_LOGIN_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698