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

Side by Side Diff: chrome/browser/chromeos/user_cros_settings_provider.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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) 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/chromeos/user_cros_settings_provider.h" 5 #include "chrome/browser/chromeos/user_cros_settings_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 12 matching lines...) Expand all
23 #include "chrome/browser/chromeos/login/ownership_service.h" 23 #include "chrome/browser/chromeos/login/ownership_service.h"
24 #include "chrome/browser/chromeos/login/ownership_status_checker.h" 24 #include "chrome/browser/chromeos/login/ownership_status_checker.h"
25 #include "chrome/browser/chromeos/login/user_manager.h" 25 #include "chrome/browser/chromeos/login/user_manager.h"
26 #include "chrome/browser/policy/browser_policy_connector.h" 26 #include "chrome/browser/policy/browser_policy_connector.h"
27 #include "chrome/browser/prefs/pref_service.h" 27 #include "chrome/browser/prefs/pref_service.h"
28 #include "chrome/browser/prefs/scoped_user_pref_update.h" 28 #include "chrome/browser/prefs/scoped_user_pref_update.h"
29 #include "chrome/browser/ui/options/options_util.h" 29 #include "chrome/browser/ui/options/options_util.h"
30 #include "chrome/common/chrome_notification_types.h" 30 #include "chrome/common/chrome_notification_types.h"
31 #include "chrome/installer/util/google_update_settings.h" 31 #include "chrome/installer/util/google_update_settings.h"
32 #include "content/browser/browser_thread.h" 32 #include "content/browser/browser_thread.h"
33 #include "content/public/browser/notification_service.h"
33 34
34 namespace chromeos { 35 namespace chromeos {
35 36
36 namespace { 37 namespace {
37 38
38 const char kTrueIncantation[] = "true"; 39 const char kTrueIncantation[] = "true";
39 const char kFalseIncantation[] = "false"; 40 const char kFalseIncantation[] = "false";
40 const char kTrustedSuffix[] = "/trusted"; 41 const char kTrustedSuffix[] = "/trusted";
41 42
42 // For all our boolean settings following is applicable: 43 // For all our boolean settings following is applicable:
(...skipping 19 matching lines...) Expand all
62 // This class provides the means to migrate settings to the signed settings 63 // This class provides the means to migrate settings to the signed settings
63 // store. It does one of three things - store the settings in the policy blob 64 // store. It does one of three things - store the settings in the policy blob
64 // immediately if the current user is the owner. Uses the 65 // immediately if the current user is the owner. Uses the
65 // SignedSettingsTempStorage if there is no owner yet, or waits for an 66 // SignedSettingsTempStorage if there is no owner yet, or waits for an
66 // OWNERSHIP_CHECKED notification to delay the storing until the owner has 67 // OWNERSHIP_CHECKED notification to delay the storing until the owner has
67 // logged in. 68 // logged in.
68 class MigrationHelper : public content::NotificationObserver { 69 class MigrationHelper : public content::NotificationObserver {
69 public: 70 public:
70 explicit MigrationHelper() : callback_(NULL) { 71 explicit MigrationHelper() : callback_(NULL) {
71 registrar_.Add(this, chrome::NOTIFICATION_OWNERSHIP_CHECKED, 72 registrar_.Add(this, chrome::NOTIFICATION_OWNERSHIP_CHECKED,
72 NotificationService::AllSources()); 73 content::NotificationService::AllSources());
73 } 74 }
74 75
75 void set_callback(SignedSettingsHelper::Callback* callback) { 76 void set_callback(SignedSettingsHelper::Callback* callback) {
76 callback_ = callback; 77 callback_ = callback;
77 } 78 }
78 79
79 void AddMigrationValue(const std::string& path, const std::string& value) { 80 void AddMigrationValue(const std::string& path, const std::string& value) {
80 migration_values_[path] = value; 81 migration_values_[path] = value;
81 } 82 }
82 83
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 if (cached_whitelist_update->Remove(email_value, NULL)) 747 if (cached_whitelist_update->Remove(email_value, NULL))
747 prefs->ScheduleSavePersistentPrefs(); 748 prefs->ScheduleSavePersistentPrefs();
748 } 749 }
749 750
750 // static 751 // static
751 void UserCrosSettingsProvider::UpdateCachedOwner(const std::string& email) { 752 void UserCrosSettingsProvider::UpdateCachedOwner(const std::string& email) {
752 UpdateCacheString(kDeviceOwner, email, USE_VALUE_SUPPLIED); 753 UpdateCacheString(kDeviceOwner, email, USE_VALUE_SUPPLIED);
753 } 754 }
754 755
755 } // namespace chromeos 756 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/tab_closeable_state_watcher_browsertest.cc ('k') | chrome/browser/chromeos/web_socket_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698