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

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

Issue 1143963002: Split NTPLoginHandler across chrome://apps and chrome://history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp fixes Created 5 years, 7 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
« no previous file with comments | « chrome/browser/ui/webui/history_login_handler.h ('k') | chrome/browser/ui/webui/history_ui.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/history_login_handler.h"
6
7 #include "base/bind.h"
8 #include "base/bind_helpers.h"
9 #include "base/values.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/webui/profile_info_watcher.h"
12 #include "content/public/browser/web_ui.h"
13
14 HistoryLoginHandler::HistoryLoginHandler() {}
15 HistoryLoginHandler::~HistoryLoginHandler() {}
16
17 void HistoryLoginHandler::RegisterMessages() {
18 profile_info_watcher_.reset(new ProfileInfoWatcher(
19 Profile::FromWebUI(web_ui()),
20 base::Bind(&HistoryLoginHandler::ProfileInfoChanged,
21 base::Unretained(this))));
22
23 web_ui()->RegisterMessageCallback("otherDevicesInitialized",
24 base::Bind(&HistoryLoginHandler::HandleOtherDevicesInitialized,
25 base::Unretained(this)));
26 }
27
28 void HistoryLoginHandler::HandleOtherDevicesInitialized(
29 const base::ListValue* /*args*/) {
30 ProfileInfoChanged();
31 }
32
33 void HistoryLoginHandler::ProfileInfoChanged() {
34 bool signed_in = !profile_info_watcher_->GetAuthenticatedUsername().empty();
35 web_ui()->CallJavascriptFunction(
36 "updateSignInState", base::FundamentalValue(signed_in));
37 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/history_login_handler.h ('k') | chrome/browser/ui/webui/history_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698