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

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

Issue 2456783006: MD History: fix script errors when navigating to /syncedTabs (or refreshing) (Closed)
Patch Set: found one more stale dep Created 4 years, 1 month 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/resources/md_history/compiled_resources2.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/ui/webui/history_login_handler.h" 5 #include "chrome/browser/ui/webui/history_login_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 AllowJavascript(); 42 AllowJavascript();
43 ProfileInfoChanged(); 43 ProfileInfoChanged();
44 } 44 }
45 45
46 void HistoryLoginHandler::ProfileInfoChanged() { 46 void HistoryLoginHandler::ProfileInfoChanged() {
47 bool signed_in = !profile_info_watcher_->GetAuthenticatedUsername().empty(); 47 bool signed_in = !profile_info_watcher_->GetAuthenticatedUsername().empty();
48 if (!signin_callback_.is_null()) 48 if (!signin_callback_.is_null())
49 signin_callback_.Run(); 49 signin_callback_.Run();
50 50
51 if (IsJavascriptAllowed()) { 51 if (IsJavascriptAllowed()) {
52 CallJavascriptFunction("cr.webUIListenerCallback", 52 CallJavascriptFunction("updateSignInState",
53 base::StringValue("sign-in-state-updated"),
54 base::FundamentalValue(signed_in)); 53 base::FundamentalValue(signed_in));
55 } 54 }
56 } 55 }
57 56
58 void HistoryLoginHandler::HandleStartSignInFlow( 57 void HistoryLoginHandler::HandleStartSignInFlow(
59 const base::ListValue* /*args*/) { 58 const base::ListValue* /*args*/) {
60 Browser* browser = 59 Browser* browser =
61 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); 60 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents());
62 browser->window()->ShowAvatarBubbleFromAvatarButton( 61 browser->window()->ShowAvatarBubbleFromAvatarButton(
63 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, 62 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN,
64 signin::ManageAccountsParams(), 63 signin::ManageAccountsParams(),
65 signin_metrics::AccessPoint::ACCESS_POINT_RECENT_TABS); 64 signin_metrics::AccessPoint::ACCESS_POINT_RECENT_TABS);
66 } 65 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/compiled_resources2.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698