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

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

Issue 7741045: Delay the metrics policy migration call to make sure ownership has been taken. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 const char* kListSettings[] = { 57 const char* kListSettings[] = {
58 kAccountsPrefUsers 58 kAccountsPrefUsers
59 }; 59 };
60 60
61 // Only write the property if the owner is the current logged on user. 61 // Only write the property if the owner is the current logged on user.
62 void StartStorePropertyOpIfOwner(const std::string& name, 62 void StartStorePropertyOpIfOwner(const std::string& name,
63 const std::string& value, 63 const std::string& value,
64 SignedSettingsHelper::Callback* callback) { 64 SignedSettingsHelper::Callback* callback) {
65 if (OwnershipService::GetSharedInstance()->CurrentUserIsOwner()) { 65 if (OwnershipService::GetSharedInstance()->CurrentUserIsOwner()) {
66 BrowserThread::PostTask(BrowserThread::UI, 66 // Delay this task by 30 seconds to ensure the ownership has been taken.
Mattias Nissler (ping if slow) 2011/08/29 10:55:26 If you really want to do this, then please put the
67 BrowserThread::PostDelayedTask(BrowserThread::UI,
67 FROM_HERE, 68 FROM_HERE,
68 base::Bind( 69 base::Bind(
69 &SignedSettingsHelper::StartStorePropertyOp, 70 &SignedSettingsHelper::StartStorePropertyOp,
70 base::Unretained(SignedSettingsHelper::Get()), 71 base::Unretained(SignedSettingsHelper::Get()),
71 name, 72 name,
72 value, 73 value,
73 callback)); 74 callback),
75 1000 * 30);
Mattias Nissler (ping if slow) 2011/08/29 10:55:26 declare a constant?
74 } 76 }
75 } 77 }
76 78
77 bool IsControlledBooleanSetting(const std::string& pref_path) { 79 bool IsControlledBooleanSetting(const std::string& pref_path) {
78 // TODO(nkostylev): Using std::find for 4 value array generates this warning 80 // TODO(nkostylev): Using std::find for 4 value array generates this warning
79 // in chroot stl_algo.h:231: error: array subscript is above array bounds. 81 // in chroot stl_algo.h:231: error: array subscript is above array bounds.
80 // GCC 4.4.3 82 // GCC 4.4.3
81 return (pref_path == kAccountsPrefAllowNewUser) || 83 return (pref_path == kAccountsPrefAllowNewUser) ||
82 (pref_path == kAccountsPrefAllowGuest) || 84 (pref_path == kAccountsPrefAllowGuest) ||
83 (pref_path == kAccountsPrefShowUserNamesOnSignIn) || 85 (pref_path == kAccountsPrefShowUserNamesOnSignIn) ||
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 if (cached_whitelist_update->Remove(email_value, NULL)) 700 if (cached_whitelist_update->Remove(email_value, NULL))
699 prefs->ScheduleSavePersistentPrefs(); 701 prefs->ScheduleSavePersistentPrefs();
700 } 702 }
701 703
702 // static 704 // static
703 void UserCrosSettingsProvider::UpdateCachedOwner(const std::string& email) { 705 void UserCrosSettingsProvider::UpdateCachedOwner(const std::string& email) {
704 UpdateCacheString(kDeviceOwner, email, USE_VALUE_SUPPLIED); 706 UpdateCacheString(kDeviceOwner, email, USE_VALUE_SUPPLIED);
705 } 707 }
706 708
707 } // namespace chromeos 709 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698