OLD | NEW |
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/settings/people_handler.h" | 5 #include "chrome/browser/ui/webui/settings/people_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 DisplayGaiaLoginInNewTabOrWindow(access_point); | 312 DisplayGaiaLoginInNewTabOrWindow(access_point); |
313 } | 313 } |
314 | 314 |
315 void PeopleHandler::DisplayGaiaLoginInNewTabOrWindow( | 315 void PeopleHandler::DisplayGaiaLoginInNewTabOrWindow( |
316 signin_metrics::AccessPoint access_point) { | 316 signin_metrics::AccessPoint access_point) { |
317 Browser* browser = | 317 Browser* browser = |
318 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); | 318 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); |
319 bool force_new_tab = false; | 319 bool force_new_tab = false; |
320 if (!browser) { | 320 if (!browser) { |
321 // Settings is not displayed in a browser window. Open a new window. | 321 // Settings is not displayed in a browser window. Open a new window. |
322 browser = new Browser(Browser::CreateParams(Browser::TYPE_TABBED, profile_, | 322 browser = |
323 chrome::GetActiveDesktop())); | 323 new Browser(Browser::CreateParams(Browser::TYPE_TABBED, profile_)); |
324 force_new_tab = true; | 324 force_new_tab = true; |
325 } | 325 } |
326 | 326 |
327 // If the signin manager already has an authenticated username, this is a | 327 // If the signin manager already has an authenticated username, this is a |
328 // re-auth scenario, and we need to ensure that the user signs in with the | 328 // re-auth scenario, and we need to ensure that the user signs in with the |
329 // same email address. | 329 // same email address. |
330 GURL url; | 330 GURL url; |
331 if (SigninManagerFactory::GetForProfile(browser->profile()) | 331 if (SigninManagerFactory::GetForProfile(browser->profile()) |
332 ->IsAuthenticated()) { | 332 ->IsAuthenticated()) { |
333 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth", | 333 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth", |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 void PeopleHandler::UpdateSyncState() { | 1000 void PeopleHandler::UpdateSyncState() { |
1001 web_ui()->CallJavascriptFunction("settings.SyncPrivateApi.sendSyncStatus", | 1001 web_ui()->CallJavascriptFunction("settings.SyncPrivateApi.sendSyncStatus", |
1002 *GetSyncStateDictionary()); | 1002 *GetSyncStateDictionary()); |
1003 } | 1003 } |
1004 | 1004 |
1005 void PeopleHandler::OnSigninAllowedPrefChange() { | 1005 void PeopleHandler::OnSigninAllowedPrefChange() { |
1006 UpdateSyncState(); | 1006 UpdateSyncState(); |
1007 } | 1007 } |
1008 | 1008 |
1009 } // namespace settings | 1009 } // namespace settings |
OLD | NEW |