Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/signin/signin_error_ui.h" | 5 #include "chrome/browser/ui/webui/signin/signin_error_ui.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 SigninErrorHandler* handler) | 35 SigninErrorHandler* handler) |
| 36 : WebDialogUI(web_ui) { | 36 : WebDialogUI(web_ui) { |
| 37 Profile* webui_profile = Profile::FromWebUI(web_ui); | 37 Profile* webui_profile = Profile::FromWebUI(web_ui); |
| 38 Profile* signin_profile; | 38 Profile* signin_profile; |
| 39 bool is_system_profile = | 39 bool is_system_profile = |
| 40 webui_profile->GetOriginalProfile()->IsSystemProfile(); | 40 webui_profile->GetOriginalProfile()->IsSystemProfile(); |
| 41 | 41 |
| 42 if (is_system_profile) { | 42 if (is_system_profile) { |
| 43 signin_profile = g_browser_process->profile_manager()->GetProfileByPath( | 43 signin_profile = g_browser_process->profile_manager()->GetProfileByPath( |
| 44 UserManager::GetSigninProfilePath()); | 44 UserManager::GetSigninProfilePath()); |
| 45 // Sign in is terminated before profile creation. | |
|
anthonyvd
2016/12/05 18:56:37
I don't think "terminated" is the right word. Prob
zmin
2016/12/08 20:42:43
Done.
| |
| 46 if (!signin_profile) | |
| 47 signin_profile = webui_profile->GetOriginalProfile(); | |
| 45 } else { | 48 } else { |
| 46 signin_profile = webui_profile; | 49 signin_profile = webui_profile; |
| 47 } | 50 } |
| 48 | 51 |
| 49 content::WebUIDataSource* source = | 52 content::WebUIDataSource* source = |
| 50 content::WebUIDataSource::Create(chrome::kChromeUISigninErrorHost); | 53 content::WebUIDataSource::Create(chrome::kChromeUISigninErrorHost); |
| 51 source->SetJsonPath("strings.js"); | 54 source->SetJsonPath("strings.js"); |
| 52 source->SetDefaultResource(IDR_SIGNIN_ERROR_HTML); | 55 source->SetDefaultResource(IDR_SIGNIN_ERROR_HTML); |
| 53 source->AddResourcePath("signin_error.js", IDR_SIGNIN_ERROR_JS); | 56 source->AddResourcePath("signin_error.js", IDR_SIGNIN_ERROR_JS); |
| 54 source->AddResourcePath("signin_shared_css.html", IDR_SIGNIN_SHARED_CSS_HTML); | 57 source->AddResourcePath("signin_shared_css.html", IDR_SIGNIN_SHARED_CSS_HTML); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 IDS_SIGNIN_ERROR_OK_BUTTON_LABEL); | 115 IDS_SIGNIN_ERROR_OK_BUTTON_LABEL); |
| 113 | 116 |
| 114 base::DictionaryValue strings; | 117 base::DictionaryValue strings; |
| 115 webui::SetLoadTimeDataDefaults(g_browser_process->GetApplicationLocale(), | 118 webui::SetLoadTimeDataDefaults(g_browser_process->GetApplicationLocale(), |
| 116 &strings); | 119 &strings); |
| 117 source->AddLocalizedStrings(strings); | 120 source->AddLocalizedStrings(strings); |
| 118 | 121 |
| 119 content::WebUIDataSource::Add(webui_profile, source); | 122 content::WebUIDataSource::Add(webui_profile, source); |
| 120 web_ui->AddMessageHandler(handler); | 123 web_ui->AddMessageHandler(handler); |
| 121 } | 124 } |
| OLD | NEW |