| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/personal_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/personal_options_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 web_ui_->GetProfile()->GetProfileSyncService(); | 365 web_ui_->GetProfile()->GetProfileSyncService(); |
| 366 if (sync_service) { | 366 if (sync_service) { |
| 367 sync_service->AddObserver(this); | 367 sync_service->AddObserver(this); |
| 368 OnStateChanged(); | 368 OnStateChanged(); |
| 369 } else { | 369 } else { |
| 370 web_ui_->CallJavascriptFunction("options.PersonalOptions.hideSyncSection"); | 370 web_ui_->CallJavascriptFunction("options.PersonalOptions.hideSyncSection"); |
| 371 } | 371 } |
| 372 } | 372 } |
| 373 | 373 |
| 374 void PersonalOptionsHandler::ThemesReset(const ListValue* args) { | 374 void PersonalOptionsHandler::ThemesReset(const ListValue* args) { |
| 375 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset")); | 375 UserMetrics::RecordAction(UserMetricsAction("Options_ThemesReset")); |
| 376 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->UseDefaultTheme(); | 376 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->UseDefaultTheme(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 #if defined(TOOLKIT_GTK) | 379 #if defined(TOOLKIT_GTK) |
| 380 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) { | 380 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) { |
| 381 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet")); | 381 UserMetrics::RecordAction(UserMetricsAction("Options_GtkThemeSet")); |
| 382 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->SetNativeTheme(); | 382 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->SetNativeTheme(); |
| 383 } | 383 } |
| 384 #endif | 384 #endif |
| 385 | 385 |
| 386 #if defined(OS_CHROMEOS) | 386 #if defined(OS_CHROMEOS) |
| 387 void PersonalOptionsHandler::LoadAccountPicture(const ListValue* args) { | 387 void PersonalOptionsHandler::LoadAccountPicture(const ListValue* args) { |
| 388 const chromeos::UserManager::User& user = | 388 const chromeos::UserManager::User& user = |
| 389 chromeos::UserManager::Get()->logged_in_user(); | 389 chromeos::UserManager::Get()->logged_in_user(); |
| 390 std::string email = user.email(); | 390 std::string email = user.email(); |
| 391 if (!email.empty()) { | 391 if (!email.empty()) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 } | 428 } |
| 429 | 429 |
| 430 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", | 430 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", |
| 431 profile_info_list); | 431 profile_info_list); |
| 432 } | 432 } |
| 433 | 433 |
| 434 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { | 434 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { |
| 435 ProfileManager::CreateMultiProfileAsync(); | 435 ProfileManager::CreateMultiProfileAsync(); |
| 436 } | 436 } |
| 437 | 437 |
| OLD | NEW |