| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/extensions/manifest_handlers/settings_overrides_handler.
h" | 5 #include "chrome/common/extensions/manifest_handlers/settings_overrides_handler.
h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // We only support one startup page even though the type of the | 166 // We only support one startup page even though the type of the |
| 167 // manifest | 167 // manifest |
| 168 // property is a list, only the first one is used. | 168 // property is a list, only the first one is used. |
| 169 RemoveWwwPrefix(info->startup_pages[0].GetContent()))); | 169 RemoveWwwPrefix(info->startup_pages[0].GetContent()))); |
| 170 } | 170 } |
| 171 if (info->homepage) { | 171 if (info->homepage) { |
| 172 PermissionsParser::AddAPIPermission( | 172 PermissionsParser::AddAPIPermission( |
| 173 extension, | 173 extension, |
| 174 new SettingsOverrideAPIPermission( | 174 new SettingsOverrideAPIPermission( |
| 175 PermissionsInfo::GetInstance()->GetByID(APIPermission::kHomepage), | 175 PermissionsInfo::GetInstance()->GetByID(APIPermission::kHomepage), |
| 176 RemoveWwwPrefix(info->homepage.get()->GetContent()))); | 176 RemoveWwwPrefix(info->homepage->GetContent()))); |
| 177 } | 177 } |
| 178 extension->SetManifestData(manifest_keys::kSettingsOverride, | 178 extension->SetManifestData(manifest_keys::kSettingsOverride, |
| 179 info.release()); | 179 info.release()); |
| 180 return true; | 180 return true; |
| 181 } | 181 } |
| 182 | 182 |
| 183 const std::vector<std::string> SettingsOverridesHandler::Keys() const { | 183 const std::vector<std::string> SettingsOverridesHandler::Keys() const { |
| 184 return SingleKey(manifest_keys::kSettingsOverride); | 184 return SingleKey(manifest_keys::kSettingsOverride); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace extensions | 187 } // namespace extensions |
| OLD | NEW |