OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/api/resources_private/resources_private_api.
h" | 5 #include "chrome/browser/extensions/api/resources_private/resources_private_api.
h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 } // namespace | 55 } // namespace |
56 | 56 |
57 namespace get_strings = api::resources_private::GetStrings; | 57 namespace get_strings = api::resources_private::GetStrings; |
58 | 58 |
59 ResourcesPrivateGetStringsFunction::ResourcesPrivateGetStringsFunction() {} | 59 ResourcesPrivateGetStringsFunction::ResourcesPrivateGetStringsFunction() {} |
60 | 60 |
61 ResourcesPrivateGetStringsFunction::~ResourcesPrivateGetStringsFunction() {} | 61 ResourcesPrivateGetStringsFunction::~ResourcesPrivateGetStringsFunction() {} |
62 | 62 |
63 ExtensionFunction::ResponseAction ResourcesPrivateGetStringsFunction::Run() { | 63 ExtensionFunction::ResponseAction ResourcesPrivateGetStringsFunction::Run() { |
64 scoped_ptr<get_strings::Params> params(get_strings::Params::Create(*args_)); | 64 std::unique_ptr<get_strings::Params> params( |
65 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); | 65 get_strings::Params::Create(*args_)); |
| 66 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue); |
66 | 67 |
67 api::resources_private::Component component = params->component; | 68 api::resources_private::Component component = params->component; |
68 | 69 |
69 switch (component) { | 70 switch (component) { |
70 case api::resources_private::COMPONENT_IDENTITY: | 71 case api::resources_private::COMPONENT_IDENTITY: |
71 AddStringsForIdentity(dict.get()); | 72 AddStringsForIdentity(dict.get()); |
72 break; | 73 break; |
73 case api::resources_private::COMPONENT_PDF: | 74 case api::resources_private::COMPONENT_PDF: |
74 AddStringsForPdf(dict.get()); | 75 AddStringsForPdf(dict.get()); |
75 break; | 76 break; |
76 case api::resources_private::COMPONENT_NONE: | 77 case api::resources_private::COMPONENT_NONE: |
77 NOTREACHED(); | 78 NOTREACHED(); |
78 } | 79 } |
79 | 80 |
80 const std::string& app_locale = g_browser_process->GetApplicationLocale(); | 81 const std::string& app_locale = g_browser_process->GetApplicationLocale(); |
81 webui::SetLoadTimeDataDefaults(app_locale, dict.get()); | 82 webui::SetLoadTimeDataDefaults(app_locale, dict.get()); |
82 | 83 |
83 return RespondNow(OneArgument(std::move(dict))); | 84 return RespondNow(OneArgument(std::move(dict))); |
84 } | 85 } |
85 | 86 |
86 } // namespace extensions | 87 } // namespace extensions |
OLD | NEW |