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

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

Issue 9693032: [uber page] Split up initialization of handlers from initialization of webui pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Initialize -> InitializeHandler, SendPageValues -> InitializePage Created 8 years, 9 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 | Annotate | Revision Log
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/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/bind.h" 10 #include "base/bind.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile); 350 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile);
351 bool is_gtk_theme = false; 351 bool is_gtk_theme = false;
352 #endif 352 #endif
353 353
354 bool is_classic_theme = !is_gtk_theme && theme_service->UsingDefaultTheme(); 354 bool is_classic_theme = !is_gtk_theme && theme_service->UsingDefaultTheme();
355 base::FundamentalValue enabled(!is_classic_theme); 355 base::FundamentalValue enabled(!is_classic_theme);
356 web_ui()->CallJavascriptFunction( 356 web_ui()->CallJavascriptFunction(
357 "options.PersonalOptions.setThemesResetButtonEnabled", enabled); 357 "options.PersonalOptions.setThemesResetButtonEnabled", enabled);
358 } 358 }
359 359
360 void PersonalOptionsHandler::Initialize() { 360 void PersonalOptionsHandler::InitializeHandler() {
361 Profile* profile = Profile::FromWebUI(web_ui()); 361 Profile* profile = Profile::FromWebUI(web_ui());
362 362
363 // Listen for theme installation. 363 // Listen for theme installation.
364 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, 364 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
365 content::Source<ThemeService>( 365 content::Source<ThemeService>(
366 ThemeServiceFactory::GetForProfile(profile))); 366 ThemeServiceFactory::GetForProfile(profile)));
367 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, 367 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
368 content::NotificationService::AllSources()); 368 content::NotificationService::AllSources());
369 ObserveThemeChanged(); 369 ObserveThemeChanged();
370 370
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 profile_info_list.Append(profile_value); 434 profile_info_list.Append(profile_value);
435 } 435 }
436 436
437 web_ui()->CallJavascriptFunction("PersonalOptions.setProfilesInfo", 437 web_ui()->CallJavascriptFunction("PersonalOptions.setProfilesInfo",
438 profile_info_list); 438 profile_info_list);
439 } 439 }
440 440
441 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { 441 void PersonalOptionsHandler::CreateProfile(const ListValue* args) {
442 ProfileManager::CreateMultiProfileAsync(); 442 ProfileManager::CreateMultiProfileAsync();
443 } 443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698