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

Side by Side Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 2393643004: [MD Settings][People] Updates positions of username and sync status message (Closed)
Patch Set: Addressed comments Created 4 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/options/browser_options_handler.h" 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "chrome/browser/profiles/profile_shortcut_manager.h" 45 #include "chrome/browser/profiles/profile_shortcut_manager.h"
46 #include "chrome/browser/profiles/profile_window.h" 46 #include "chrome/browser/profiles/profile_window.h"
47 #include "chrome/browser/profiles/profiles_state.h" 47 #include "chrome/browser/profiles/profiles_state.h"
48 #include "chrome/browser/search/hotword_audio_history_handler.h" 48 #include "chrome/browser/search/hotword_audio_history_handler.h"
49 #include "chrome/browser/search/hotword_service.h" 49 #include "chrome/browser/search/hotword_service.h"
50 #include "chrome/browser/search/hotword_service_factory.h" 50 #include "chrome/browser/search/hotword_service_factory.h"
51 #include "chrome/browser/search/search.h" 51 #include "chrome/browser/search/search.h"
52 #include "chrome/browser/search_engines/template_url_service_factory.h" 52 #include "chrome/browser/search_engines/template_url_service_factory.h"
53 #include "chrome/browser/signin/easy_unlock_service.h" 53 #include "chrome/browser/signin/easy_unlock_service.h"
54 #include "chrome/browser/signin/signin_manager_factory.h" 54 #include "chrome/browser/signin/signin_manager_factory.h"
55 #include "chrome/browser/signin/signin_ui_util.h"
55 #include "chrome/browser/sync/profile_sync_service_factory.h" 56 #include "chrome/browser/sync/profile_sync_service_factory.h"
56 #include "chrome/browser/sync/sync_ui_util.h" 57 #include "chrome/browser/sync/sync_ui_util.h"
57 #include "chrome/browser/themes/theme_service.h" 58 #include "chrome/browser/themes/theme_service.h"
58 #include "chrome/browser/themes/theme_service_factory.h" 59 #include "chrome/browser/themes/theme_service_factory.h"
59 #include "chrome/browser/ui/browser_finder.h" 60 #include "chrome/browser/ui/browser_finder.h"
60 #include "chrome/browser/ui/chrome_select_file_policy.h" 61 #include "chrome/browser/ui/chrome_select_file_policy.h"
61 #include "chrome/browser/ui/passwords/manage_passwords_view_utils_desktop.h" 62 #include "chrome/browser/ui/passwords/manage_passwords_view_utils_desktop.h"
62 #include "chrome/browser/ui/webui/favicon_source.h" 63 #include "chrome/browser/ui/webui/favicon_source.h"
63 #include "chrome/browser/ui/webui/profile_helper.h" 64 #include "chrome/browser/ui/webui/profile_helper.h"
64 #include "chrome/common/chrome_constants.h" 65 #include "chrome/common/chrome_constants.h"
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 bool status_has_error = 1557 bool status_has_error =
1557 sync_ui_util::GetStatusLabels(profile, service, *signin, 1558 sync_ui_util::GetStatusLabels(profile, service, *signin,
1558 sync_ui_util::WITH_HTML, &status_label, 1559 sync_ui_util::WITH_HTML, &status_label,
1559 &link_label) == sync_ui_util::SYNC_ERROR; 1560 &link_label) == sync_ui_util::SYNC_ERROR;
1560 sync_status->SetString("statusText", status_label); 1561 sync_status->SetString("statusText", status_label);
1561 sync_status->SetString("actionLinkText", link_label); 1562 sync_status->SetString("actionLinkText", link_label);
1562 sync_status->SetBoolean("hasError", status_has_error); 1563 sync_status->SetBoolean("hasError", status_has_error);
1563 1564
1564 sync_status->SetBoolean("managed", service && service->IsManaged()); 1565 sync_status->SetBoolean("managed", service && service->IsManaged());
1565 sync_status->SetBoolean("signedIn", signin->IsAuthenticated()); 1566 sync_status->SetBoolean("signedIn", signin->IsAuthenticated());
1567 sync_status->SetString("accountInfo",
1568 l10n_util::GetStringFUTF16(
1569 IDS_SYNC_ACCOUNT_INFO,
1570 signin_ui_util::GetAuthenticatedUsername(signin)));
1566 sync_status->SetBoolean("hasUnrecoverableError", 1571 sync_status->SetBoolean("hasUnrecoverableError",
1567 service && service->HasUnrecoverableError()); 1572 service && service->HasUnrecoverableError());
1568 1573
1569 return sync_status; 1574 return sync_status;
1570 } 1575 }
1571 1576
1572 void BrowserOptionsHandler::HandleSelectDownloadLocation( 1577 void BrowserOptionsHandler::HandleSelectDownloadLocation(
1573 const base::ListValue* args) { 1578 const base::ListValue* args) {
1574 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); 1579 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
1575 select_folder_dialog_ = ui::SelectFileDialog::Create( 1580 select_folder_dialog_ = ui::SelectFileDialog::Create(
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 2239
2235 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { 2240 bool BrowserOptionsHandler::IsDeviceOwnerProfile() {
2236 #if defined(OS_CHROMEOS) 2241 #if defined(OS_CHROMEOS)
2237 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); 2242 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui()));
2238 #else 2243 #else
2239 return true; 2244 return true;
2240 #endif 2245 #endif
2241 } 2246 }
2242 2247
2243 } // namespace options 2248 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698