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

Side by Side Diff: chrome/browser/ui/webui/settings/people_handler.h

Issue 1776393003: MD Settings: avoid double pref observation on Startup Pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unordered_set Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/scoped_observer.h" 11 #include "base/scoped_observer.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/timer/timer.h" 13 #include "base/timer/timer.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "chrome/browser/profiles/profile_attributes_storage.h" 15 #include "chrome/browser/profiles/profile_attributes_storage.h"
16 #include "chrome/browser/sync/sync_startup_tracker.h" 16 #include "chrome/browser/sync/sync_startup_tracker.h"
17 #include "chrome/browser/ui/webui/settings/md_settings_ui.h"
17 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 18 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
18 #include "components/prefs/pref_change_registrar.h" 19 #include "components/prefs/pref_change_registrar.h"
19 #include "components/signin/core/browser/signin_manager_base.h" 20 #include "components/signin/core/browser/signin_manager_base.h"
20 #include "components/sync_driver/sync_service_observer.h" 21 #include "components/sync_driver/sync_service_observer.h"
21 #include "content/public/browser/web_ui_message_handler.h"
22 22
23 #if defined(OS_CHROMEOS) 23 #if defined(OS_CHROMEOS)
24 #include "content/public/browser/notification_observer.h" 24 #include "content/public/browser/notification_observer.h"
25 #include "content/public/browser/notification_registrar.h" 25 #include "content/public/browser/notification_registrar.h"
26 #endif 26 #endif
27 27
28 class LoginUIService; 28 class LoginUIService;
29 class ProfileSyncService; 29 class ProfileSyncService;
30 class SigninManagerBase; 30 class SigninManagerBase;
31 31
32 namespace content { 32 namespace content {
33 class WebContents; 33 class WebContents;
34 class WebUI; 34 class WebUI;
35 } 35 }
36 36
37 namespace signin_metrics { 37 namespace signin_metrics {
38 enum class AccessPoint; 38 enum class AccessPoint;
39 } 39 }
40 40
41 namespace settings { 41 namespace settings {
42 42
43 class PeopleHandler : public content::WebUIMessageHandler, 43 class PeopleHandler : public SettingsPageUIHandler,
michaelpg 2016/03/11 01:16:54 why?
Dan Beam 2016/03/11 05:39:06 I restricted AddSettingsPageUIHandler() to take a
44 public SigninManagerBase::Observer, 44 public SigninManagerBase::Observer,
45 public SyncStartupTracker::Observer, 45 public SyncStartupTracker::Observer,
46 public LoginUIService::LoginUI, 46 public LoginUIService::LoginUI,
47 public sync_driver::SyncServiceObserver, 47 public sync_driver::SyncServiceObserver,
48 #if defined(OS_CHROMEOS) 48 #if defined(OS_CHROMEOS)
49 public content::NotificationObserver, 49 public content::NotificationObserver,
50 #endif 50 #endif
51 public ProfileAttributesStorage::Observer { 51 public ProfileAttributesStorage::Observer {
52 public: 52 public:
53 explicit PeopleHandler(Profile* profile); 53 explicit PeopleHandler(Profile* profile);
54 ~PeopleHandler() override; 54 ~PeopleHandler() override;
55 55
56 // content::WebUIMessageHandler implementation. 56 // SettingsPageUIHandler implementation.
57 void RegisterMessages() override; 57 void RegisterMessages() override;
58 58
59 // SyncStartupTracker::Observer implementation. 59 // SyncStartupTracker::Observer implementation.
60 void SyncStartupCompleted() override; 60 void SyncStartupCompleted() override;
61 void SyncStartupFailed() override; 61 void SyncStartupFailed() override;
62 62
63 // LoginUIService::LoginUI implementation. 63 // LoginUIService::LoginUI implementation.
64 void FocusUI() override; 64 void FocusUI() override;
65 void CloseUI() override; 65 void CloseUI() override;
66 66
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 // Manages observer lifetime. 221 // Manages observer lifetime.
222 ScopedObserver<ProfileSyncService, PeopleHandler> sync_service_observer_; 222 ScopedObserver<ProfileSyncService, PeopleHandler> sync_service_observer_;
223 223
224 DISALLOW_COPY_AND_ASSIGN(PeopleHandler); 224 DISALLOW_COPY_AND_ASSIGN(PeopleHandler);
225 }; 225 };
226 226
227 } // namespace settings 227 } // namespace settings
228 228
229 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ 229 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698