OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_ASH_CHROME_LAUNCHER_PREFS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_CHROME_LAUNCHER_PREFS_H_ |
6 #define CHROME_BROWSER_UI_ASH_CHROME_LAUNCHER_PREFS_H_ | 6 #define CHROME_BROWSER_UI_ASH_CHROME_LAUNCHER_PREFS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "ash/public/cpp/shelf_types.h" | 12 #include "ash/public/cpp/shelf_types.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "components/syncable_prefs/pref_service_syncable_observer.h" | 14 #include "components/sync_preferences/pref_service_syncable_observer.h" |
15 | 15 |
16 class LauncherControllerHelper; | 16 class LauncherControllerHelper; |
17 class PrefService; | 17 class PrefService; |
18 class Profile; | 18 class Profile; |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class DictionaryValue; | 21 class DictionaryValue; |
22 } | 22 } |
23 | 23 |
24 namespace syncable_prefs { | 24 namespace sync_preferences { |
25 class PrefServiceSyncable; | 25 class PrefServiceSyncable; |
26 } | 26 } |
27 | 27 |
28 namespace user_prefs { | 28 namespace user_prefs { |
29 class PrefRegistrySyncable; | 29 class PrefRegistrySyncable; |
30 } | 30 } |
31 | 31 |
32 namespace ash { | 32 namespace ash { |
33 namespace launcher { | 33 namespace launcher { |
34 | 34 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // |app_launcher_id|. |app_launcher_id_before| optionally specifies an app that | 116 // |app_launcher_id|. |app_launcher_id_before| optionally specifies an app that |
117 // exists right before the target app. |app_launcher_ids_after| optionally | 117 // exists right before the target app. |app_launcher_ids_after| optionally |
118 // specifies sorted by position apps that exist right after the target app. | 118 // specifies sorted by position apps that exist right after the target app. |
119 void SetPinPosition(Profile* profile, | 119 void SetPinPosition(Profile* profile, |
120 const AppLauncherId& app_launcher_id, | 120 const AppLauncherId& app_launcher_id, |
121 const AppLauncherId& app_launcher_id_before, | 121 const AppLauncherId& app_launcher_id_before, |
122 const std::vector<AppLauncherId>& app_launcher_ids_after); | 122 const std::vector<AppLauncherId>& app_launcher_ids_after); |
123 | 123 |
124 // Used to propagate remote preferences to local during the first run. | 124 // Used to propagate remote preferences to local during the first run. |
125 class ChromeLauncherPrefsObserver | 125 class ChromeLauncherPrefsObserver |
126 : public syncable_prefs::PrefServiceSyncableObserver { | 126 : public sync_preferences::PrefServiceSyncableObserver { |
127 public: | 127 public: |
128 // Creates and returns an instance of ChromeLauncherPrefsObserver if the | 128 // Creates and returns an instance of ChromeLauncherPrefsObserver if the |
129 // profile prefs do not contain all the necessary local settings for the | 129 // profile prefs do not contain all the necessary local settings for the |
130 // shelf. If the local settings are present, returns null. | 130 // shelf. If the local settings are present, returns null. |
131 static std::unique_ptr<ChromeLauncherPrefsObserver> CreateIfNecessary( | 131 static std::unique_ptr<ChromeLauncherPrefsObserver> CreateIfNecessary( |
132 Profile* profile); | 132 Profile* profile); |
133 | 133 |
134 ~ChromeLauncherPrefsObserver() override; | 134 ~ChromeLauncherPrefsObserver() override; |
135 | 135 |
136 private: | 136 private: |
137 explicit ChromeLauncherPrefsObserver( | 137 explicit ChromeLauncherPrefsObserver( |
138 syncable_prefs::PrefServiceSyncable* prefs); | 138 sync_preferences::PrefServiceSyncable* prefs); |
139 | 139 |
140 // syncable_prefs::PrefServiceSyncableObserver: | 140 // sync_preferences::PrefServiceSyncableObserver: |
141 void OnIsSyncingChanged() override; | 141 void OnIsSyncingChanged() override; |
142 | 142 |
143 // Profile prefs. Not owned. | 143 // Profile prefs. Not owned. |
144 syncable_prefs::PrefServiceSyncable* prefs_; | 144 sync_preferences::PrefServiceSyncable* prefs_; |
145 | 145 |
146 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherPrefsObserver); | 146 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherPrefsObserver); |
147 }; | 147 }; |
148 | 148 |
149 } // namespace launcher | 149 } // namespace launcher |
150 } // namespace ash | 150 } // namespace ash |
151 | 151 |
152 #endif // CHROME_BROWSER_UI_ASH_CHROME_LAUNCHER_PREFS_H_ | 152 #endif // CHROME_BROWSER_UI_ASH_CHROME_LAUNCHER_PREFS_H_ |
OLD | NEW |