| 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 web_ui_->CallJavascriptFunction("PersonalOptions.setRegisteredDataTypes", | 378 web_ui_->CallJavascriptFunction("PersonalOptions.setRegisteredDataTypes", |
| 379 args); | 379 args); |
| 380 } else { | 380 } else { |
| 381 web_ui_->CallJavascriptFunction("options.PersonalOptions.hideSyncSection"); | 381 web_ui_->CallJavascriptFunction("options.PersonalOptions.hideSyncSection"); |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 | 384 |
| 385 void PersonalOptionsHandler::ShowSyncActionDialog(const ListValue* args) { | 385 void PersonalOptionsHandler::ShowSyncActionDialog(const ListValue* args) { |
| 386 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); | 386 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); |
| 387 DCHECK(service); | 387 DCHECK(service); |
| 388 service->ShowErrorUI(); | 388 service->ShowErrorUI(web_ui_); |
| 389 } | 389 } |
| 390 | 390 |
| 391 void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) { | 391 void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) { |
| 392 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); | 392 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); |
| 393 DCHECK(service); | 393 DCHECK(service); |
| 394 service->ShowLoginDialog(); | 394 service->ShowLoginDialog(web_ui_); |
| 395 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); | 395 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); |
| 396 } | 396 } |
| 397 | 397 |
| 398 void PersonalOptionsHandler::ShowCustomizeSyncDialog(const ListValue* args) { | 398 void PersonalOptionsHandler::ShowCustomizeSyncDialog(const ListValue* args) { |
| 399 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); | 399 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); |
| 400 DCHECK(service); | 400 DCHECK(service); |
| 401 service->ShowConfigure(false); | 401 service->ShowConfigure(web_ui_, false); |
| 402 } | 402 } |
| 403 | 403 |
| 404 void PersonalOptionsHandler::ThemesReset(const ListValue* args) { | 404 void PersonalOptionsHandler::ThemesReset(const ListValue* args) { |
| 405 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset")); | 405 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset")); |
| 406 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->UseDefaultTheme(); | 406 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->UseDefaultTheme(); |
| 407 } | 407 } |
| 408 | 408 |
| 409 #if defined(TOOLKIT_GTK) | 409 #if defined(TOOLKIT_GTK) |
| 410 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) { | 410 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) { |
| 411 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet")); | 411 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet")); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 424 long long timestamp = base::TimeTicks::Now().ToInternalValue(); | 424 long long timestamp = base::TimeTicks::Now().ToInternalValue(); |
| 425 StringValue image_url( | 425 StringValue image_url( |
| 426 StringPrintf("%s%s?id=%lld", | 426 StringPrintf("%s%s?id=%lld", |
| 427 chrome::kChromeUIUserImageURL, | 427 chrome::kChromeUIUserImageURL, |
| 428 email.c_str(), | 428 email.c_str(), |
| 429 timestamp)); | 429 timestamp)); |
| 430 web_ui_->CallJavascriptFunction("PersonalOptions.setAccountPicture", | 430 web_ui_->CallJavascriptFunction("PersonalOptions.setAccountPicture", |
| 431 image_url); | 431 image_url); |
| 432 } | 432 } |
| 433 } | 433 } |
| 434 | |
| 435 #endif | 434 #endif |
| OLD | NEW |