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

Side by Side Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again; base::File changes conflicted. Created 7 years, 10 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/ntp/app_launcher_handler.h" 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
13 #include "base/metrics/field_trial.h" 13 #include "base/metrics/field_trial.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/extensions/app_notification.h" 17 #include "chrome/browser/extensions/app_notification.h"
18 #include "chrome/browser/extensions/app_notification_manager.h" 18 #include "chrome/browser/extensions/app_notification_manager.h"
19 #include "chrome/browser/extensions/crx_installer.h" 19 #include "chrome/browser/extensions/crx_installer.h"
20 #include "chrome/browser/extensions/extension_prefs.h" 20 #include "chrome/browser/extensions/extension_prefs.h"
21 #include "chrome/browser/extensions/extension_service.h" 21 #include "chrome/browser/extensions/extension_service.h"
22 #include "chrome/browser/extensions/extension_sorting.h" 22 #include "chrome/browser/extensions/extension_sorting.h"
23 #include "chrome/browser/extensions/extension_system.h" 23 #include "chrome/browser/extensions/extension_system.h"
24 #include "chrome/browser/extensions/management_policy.h" 24 #include "chrome/browser/extensions/management_policy.h"
25 #include "chrome/browser/favicon/favicon_service_factory.h" 25 #include "chrome/browser/favicon/favicon_service_factory.h"
26 #include "chrome/browser/prefs/pref_registry_syncable.h"
26 #include "chrome/browser/prefs/pref_service.h" 27 #include "chrome/browser/prefs/pref_service.h"
27 #include "chrome/browser/prefs/scoped_user_pref_update.h" 28 #include "chrome/browser/prefs/scoped_user_pref_update.h"
28 #include "chrome/browser/profiles/profile.h" 29 #include "chrome/browser/profiles/profile.h"
29 #include "chrome/browser/ui/browser_finder.h" 30 #include "chrome/browser/ui/browser_finder.h"
30 #include "chrome/browser/ui/browser_tabstrip.h" 31 #include "chrome/browser/ui/browser_tabstrip.h"
31 #include "chrome/browser/ui/browser_window.h" 32 #include "chrome/browser/ui/browser_window.h"
32 #include "chrome/browser/ui/extensions/application_launch.h" 33 #include "chrome/browser/ui/extensions/application_launch.h"
33 #include "chrome/browser/ui/extensions/extension_enable_flow.h" 34 #include "chrome/browser/ui/extensions/extension_enable_flow.h"
34 #include "chrome/browser/ui/tabs/tab_strip_model.h" 35 #include "chrome/browser/ui/tabs/tab_strip_model.h"
35 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 36 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 highlight_app_id_.clear(); 770 highlight_app_id_.clear();
770 } 771 }
771 772
772 void AppLauncherHandler::OnPreferenceChanged() { 773 void AppLauncherHandler::OnPreferenceChanged() {
773 DictionaryValue dictionary; 774 DictionaryValue dictionary;
774 FillAppDictionary(&dictionary); 775 FillAppDictionary(&dictionary);
775 web_ui()->CallJavascriptFunction("ntp.appsPrefChangeCallback", dictionary); 776 web_ui()->CallJavascriptFunction("ntp.appsPrefChangeCallback", dictionary);
776 } 777 }
777 778
778 // static 779 // static
779 void AppLauncherHandler::RegisterUserPrefs(PrefServiceSyncable* pref_service) { 780 void AppLauncherHandler::RegisterUserPrefs(PrefRegistrySyncable* registry) {
780 pref_service->RegisterListPref(prefs::kNtpAppPageNames, 781 registry->RegisterListPref(prefs::kNtpAppPageNames,
781 PrefServiceSyncable::SYNCABLE_PREF); 782 PrefRegistrySyncable::SYNCABLE_PREF);
782 } 783 }
783 784
784 void AppLauncherHandler::CleanupAfterUninstall() { 785 void AppLauncherHandler::CleanupAfterUninstall() {
785 extension_id_prompting_.clear(); 786 extension_id_prompting_.clear();
786 } 787 }
787 788
788 // static 789 // static
789 void AppLauncherHandler::RecordAppLaunchType( 790 void AppLauncherHandler::RecordAppLaunchType(
790 extension_misc::AppLaunchBucket bucket) { 791 extension_misc::AppLaunchBucket bucket) {
791 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, bucket, 792 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, bucket,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { 885 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() {
885 if (!extension_uninstall_dialog_.get()) { 886 if (!extension_uninstall_dialog_.get()) {
886 Browser* browser = chrome::FindBrowserWithWebContents( 887 Browser* browser = chrome::FindBrowserWithWebContents(
887 web_ui()->GetWebContents()); 888 web_ui()->GetWebContents());
888 extension_uninstall_dialog_.reset( 889 extension_uninstall_dialog_.reset(
889 ExtensionUninstallDialog::Create(extension_service_->profile(), 890 ExtensionUninstallDialog::Create(extension_service_->profile(),
890 browser, this)); 891 browser, this));
891 } 892 }
892 return extension_uninstall_dialog_.get(); 893 return extension_uninstall_dialog_.get();
893 } 894 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.h ('k') | chrome/browser/ui/webui/ntp/foreign_session_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698