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

Unified Diff: chrome/browser/ui/webui/options/manage_profile_handler.cc

Issue 225523004: Updates the UI and reenables the fix introduced in commit 256939 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes review comments and some minor changes in the UI Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/manage_profile_handler.cc
diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.cc b/chrome/browser/ui/webui/options/manage_profile_handler.cc
index 40cef2fa0f798afdc4a808df4137620d96006d7d..671846e0cb64366cdd64fc4499f524b3eb8fc0c9 100644
--- a/chrome/browser/ui/webui/options/manage_profile_handler.cc
+++ b/chrome/browser/ui/webui/options/manage_profile_handler.cc
@@ -35,6 +35,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_ui.h"
+#include "google_apis/gaia/gaia_auth_util.h"
#include "grit/generated_resources.h"
#include "grit/google_chrome_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -105,10 +106,6 @@ void ManageProfileHandler::GetLocalizedValues(
IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_TITLE },
{ "disconnectManagedProfileOK",
IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_OK_BUTTON_LABEL },
- { "disconnectManagedProfileText",
- IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_TEXT },
- { "disconnectManagedProfileLearnMore",
- IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_LEARN_MORE },
{ "createProfileTitle", IDS_PROFILES_CREATE_TITLE },
{ "createProfileInstructions", IDS_PROFILES_CREATE_INSTRUCTIONS },
{ "createProfileConfirm", IDS_PROFILES_CREATE_CONFIRM },
@@ -130,8 +127,27 @@ void ManageProfileHandler::GetLocalizedValues(
localized_strings->SetBoolean("profileShortcutsEnabled",
ProfileShortcutManager::IsFeatureEnabled());
- localized_strings->SetString("enterpriseManagedAccountHelpURL",
- chrome::kEnterpriseManagedAccountHelpURL);
+ Profile* profile = Profile::FromWebUI(web_ui());
+ DCHECK(profile);
+ SigninManagerBase* manager = SigninManagerFactory::GetForProfile(profile);
+ DCHECK(manager);
+ std::string username = manager->GetAuthenticatedUsername();
+ std::string domain_name = "<span id=disconnect-managed-profile-domain-name>" +
Patrick Dubroy 2014/04/24 23:23:52 Sorry, I should have been more clear -- the string
Andrew T Wilson (Slow) 2014/04/25 11:50:05 How can he do this, given that it's embedded in an
Patrick Dubroy 2014/04/25 16:38:46 My mistake, I didn't look closely enough. In that
+ gaia::ExtractDomainName(username) + "</span>";
+ // If there is no one logged in or if the profile name is empty then the
+ // domain name is unknown. This happens in browser tests.
+ localized_strings->SetString(
+ "disconnectManagedProfileDomainInformation",
+ l10n_util::GetStringFUTF16(
+ IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_DOMAIN_INFORMATION,
+ base::ASCIIToUTF16(domain_name)));
+
+ localized_strings->SetString(
+ "disconnectManagedProfileText",
+ l10n_util::GetStringFUTF16(
+ IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_TEXT,
+ base::UTF8ToUTF16(username),
+ base::UTF8ToUTF16(chrome::kSyncGoogleDashboardURL)));
}
void ManageProfileHandler::InitializeHandler() {

Powered by Google App Engine
This is Rietveld 408576698