| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 #endif | 350 #endif |
| 351 | 351 |
| 352 bool is_classic_theme = !is_gtk_theme && theme_service->UsingDefaultTheme(); | 352 bool is_classic_theme = !is_gtk_theme && theme_service->UsingDefaultTheme(); |
| 353 FundamentalValue enabled(!is_classic_theme); | 353 FundamentalValue enabled(!is_classic_theme); |
| 354 web_ui_->CallJavascriptFunction( | 354 web_ui_->CallJavascriptFunction( |
| 355 "options.PersonalOptions.setThemesResetButtonEnabled", enabled); | 355 "options.PersonalOptions.setThemesResetButtonEnabled", enabled); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void PersonalOptionsHandler::Initialize() { | 358 void PersonalOptionsHandler::Initialize() { |
| 359 banner_handler_.reset( | 359 banner_handler_.reset( |
| 360 new OptionsManagedBannerHandler(web_ui_, | 360 OptionsManagedBannerHandler::Create(web_ui_, |
| 361 ASCIIToUTF16("PersonalOptions"), | 361 ASCIIToUTF16("PersonalOptions"), |
| 362 OPTIONS_PAGE_CONTENT)); | 362 OPTIONS_PAGE_CONTENT)); |
| 363 | 363 |
| 364 // Listen for theme installation. | 364 // Listen for theme installation. |
| 365 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, | 365 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, |
| 366 NotificationService::AllSources()); | 366 NotificationService::AllSources()); |
| 367 ObserveThemeChanged(); | 367 ObserveThemeChanged(); |
| 368 | 368 |
| 369 ProfileSyncService* sync_service = | 369 ProfileSyncService* sync_service = |
| 370 web_ui_->GetProfile()->GetProfileSyncService(); | 370 web_ui_->GetProfile()->GetProfileSyncService(); |
| 371 if (sync_service) { | 371 if (sync_service) { |
| 372 sync_service->AddObserver(this); | 372 sync_service->AddObserver(this); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 #endif | 434 #endif |
| OLD | NEW |