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 "extensions/common/manifest_handlers/options_page_info.h" | 5 #include "extensions/common/manifest_handlers/options_page_info.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "extensions/common/api/extensions_manifest_types.h" | 10 #include "extensions/common/api/extensions_manifest_types.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 | 106 |
107 scoped_ptr<OptionsPageInfo> OptionsPageInfo::Create( | 107 scoped_ptr<OptionsPageInfo> OptionsPageInfo::Create( |
108 Extension* extension, | 108 Extension* extension, |
109 const base::Value* options_ui_value, | 109 const base::Value* options_ui_value, |
110 const std::string& options_page_string, | 110 const std::string& options_page_string, |
111 std::vector<InstallWarning>* install_warnings, | 111 std::vector<InstallWarning>* install_warnings, |
112 base::string16* error) { | 112 base::string16* error) { |
113 GURL options_page; | 113 GURL options_page; |
114 bool chrome_style = false; | 114 bool chrome_style = false; |
115 bool open_in_tab = !FeatureSwitch::embedded_extension_options()->IsEnabled(); | 115 bool open_in_tab = false; |
116 | 116 |
117 // Parse the options_ui object. | 117 // Parse the options_ui object. |
118 if (options_ui_value && | 118 if (options_ui_value) { |
119 FeatureSwitch::embedded_extension_options()->IsEnabled()) { | |
120 base::string16 options_ui_error; | 119 base::string16 options_ui_error; |
121 | 120 |
122 scoped_ptr<OptionsUI> options_ui = | 121 scoped_ptr<OptionsUI> options_ui = |
123 OptionsUI::FromValue(*options_ui_value, &options_ui_error); | 122 OptionsUI::FromValue(*options_ui_value, &options_ui_error); |
124 if (!options_ui_error.empty()) { | 123 if (!options_ui_error.empty()) { |
125 // OptionsUI::FromValue populates |error| both when there are | 124 // OptionsUI::FromValue populates |error| both when there are |
126 // errors (in which case |options_ui| will be NULL) and warnings | 125 // errors (in which case |options_ui| will be NULL) and warnings |
127 // (in which case |options_ui| will be valid). Either way, show it | 126 // (in which case |options_ui| will be valid). Either way, show it |
128 // as an install warning. | 127 // as an install warning. |
129 install_warnings->push_back( | 128 install_warnings->push_back( |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 } | 216 } |
218 return true; | 217 return true; |
219 } | 218 } |
220 | 219 |
221 const std::vector<std::string> OptionsPageManifestHandler::Keys() const { | 220 const std::vector<std::string> OptionsPageManifestHandler::Keys() const { |
222 static const char* keys[] = {keys::kOptionsPage, keys::kOptionsUI}; | 221 static const char* keys[] = {keys::kOptionsPage, keys::kOptionsUI}; |
223 return std::vector<std::string>(keys, keys + arraysize(keys)); | 222 return std::vector<std::string>(keys, keys + arraysize(keys)); |
224 } | 223 } |
225 | 224 |
226 } // namespace extensions | 225 } // namespace extensions |
OLD | NEW |