| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "extensions/common/manifest_handlers/oauth2_manifest_handler.h" | 5 #include "extensions/common/manifest_handlers/oauth2_manifest_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 namespace extensions { | 26 namespace extensions { |
| 27 | 27 |
| 28 namespace keys = manifest_keys; | 28 namespace keys = manifest_keys; |
| 29 namespace errors = manifest_errors; | 29 namespace errors = manifest_errors; |
| 30 | 30 |
| 31 OAuth2Info::OAuth2Info() : auto_approve(false) {} | 31 OAuth2Info::OAuth2Info() : auto_approve(false) {} |
| 32 OAuth2Info::~OAuth2Info() {} | 32 OAuth2Info::~OAuth2Info() {} |
| 33 | 33 |
| 34 static base::LazyInstance<OAuth2Info> g_empty_oauth2_info = | 34 static base::LazyInstance<OAuth2Info>::DestructorAtExit g_empty_oauth2_info = |
| 35 LAZY_INSTANCE_INITIALIZER; | 35 LAZY_INSTANCE_INITIALIZER; |
| 36 | 36 |
| 37 // static | 37 // static |
| 38 const OAuth2Info& OAuth2Info::GetOAuth2Info(const Extension* extension) { | 38 const OAuth2Info& OAuth2Info::GetOAuth2Info(const Extension* extension) { |
| 39 OAuth2Info* info = static_cast<OAuth2Info*>( | 39 OAuth2Info* info = static_cast<OAuth2Info*>( |
| 40 extension->GetManifestData(keys::kOAuth2)); | 40 extension->GetManifestData(keys::kOAuth2)); |
| 41 return info ? *info : g_empty_oauth2_info.Get(); | 41 return info ? *info : g_empty_oauth2_info.Get(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 OAuth2ManifestHandler::OAuth2ManifestHandler() { | 44 OAuth2ManifestHandler::OAuth2ManifestHandler() { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 extension->SetManifestData(keys::kOAuth2, std::move(info)); | 93 extension->SetManifestData(keys::kOAuth2, std::move(info)); |
| 94 return true; | 94 return true; |
| 95 } | 95 } |
| 96 | 96 |
| 97 const std::vector<std::string> OAuth2ManifestHandler::Keys() const { | 97 const std::vector<std::string> OAuth2ManifestHandler::Keys() const { |
| 98 return SingleKey(keys::kOAuth2); | 98 return SingleKey(keys::kOAuth2); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace extensions | 101 } // namespace extensions |
| OLD | NEW |