| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/apps/drive/drive_app_mapping.h" | 5 #include "chrome/browser/apps/drive/drive_app_mapping.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 scoped_ptr<base::DictionaryValue> CreateInfoDict( | 24 scoped_ptr<base::DictionaryValue> CreateInfoDict( |
| 25 const std::string& chrome_app_id, | 25 const std::string& chrome_app_id, |
| 26 bool generated) { | 26 bool generated) { |
| 27 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); | 27 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); |
| 28 dict->SetStringWithoutPathExpansion(kKeyChromeApp, chrome_app_id); | 28 dict->SetStringWithoutPathExpansion(kKeyChromeApp, chrome_app_id); |
| 29 | 29 |
| 30 // Only writes non-default value. | 30 // Only writes non-default value. |
| 31 if (generated) | 31 if (generated) |
| 32 dict->SetBooleanWithoutPathExpansion(kKeyGenerated, true); | 32 dict->SetBooleanWithoutPathExpansion(kKeyGenerated, true); |
| 33 return dict.Pass(); | 33 return dict; |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 DriveAppMapping::DriveAppMapping(PrefService* prefs) : prefs_(prefs) { | 38 DriveAppMapping::DriveAppMapping(PrefService* prefs) : prefs_(prefs) { |
| 39 GetUninstalledIdsFromPref(); | 39 GetUninstalledIdsFromPref(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 DriveAppMapping::~DriveAppMapping() { | 42 DriveAppMapping::~DriveAppMapping() { |
| 43 } | 43 } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 uninstalled_app_ids_.insert(app_id); | 160 uninstalled_app_ids_.insert(app_id); |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 | 163 |
| 164 void DriveAppMapping::UpdateUninstalledList() { | 164 void DriveAppMapping::UpdateUninstalledList() { |
| 165 ListPrefUpdate update(prefs_, prefs::kAppLauncherUninstalledDriveApps); | 165 ListPrefUpdate update(prefs_, prefs::kAppLauncherUninstalledDriveApps); |
| 166 update->Clear(); | 166 update->Clear(); |
| 167 for (const auto& app_id : uninstalled_app_ids_) | 167 for (const auto& app_id : uninstalled_app_ids_) |
| 168 update->AppendString(app_id); | 168 update->AppendString(app_id); |
| 169 } | 169 } |
| OLD | NEW |