Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: extensions/common/manifest_handlers/options_page_info.cc

Issue 571213003: Revert "Embedded Extension Options: remove flags and trunk channel restrictions" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/common/feature_switch.cc ('k') | extensions/common/switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/files/file_util.h" 7 #include "base/files/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
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 = false; 115 bool open_in_tab = !FeatureSwitch::embedded_extension_options()->IsEnabled();
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()) {
119 base::string16 options_ui_error; 120 base::string16 options_ui_error;
120 121
121 scoped_ptr<OptionsUI> options_ui = 122 scoped_ptr<OptionsUI> options_ui =
122 OptionsUI::FromValue(*options_ui_value, &options_ui_error); 123 OptionsUI::FromValue(*options_ui_value, &options_ui_error);
123 if (!options_ui_error.empty()) { 124 if (!options_ui_error.empty()) {
124 // OptionsUI::FromValue populates |error| both when there are 125 // OptionsUI::FromValue populates |error| both when there are
125 // errors (in which case |options_ui| will be NULL) and warnings 126 // errors (in which case |options_ui| will be NULL) and warnings
126 // (in which case |options_ui| will be valid). Either way, show it 127 // (in which case |options_ui| will be valid). Either way, show it
127 // as an install warning. 128 // as an install warning.
128 install_warnings->push_back( 129 install_warnings->push_back(
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 217 }
217 return true; 218 return true;
218 } 219 }
219 220
220 const std::vector<std::string> OptionsPageManifestHandler::Keys() const { 221 const std::vector<std::string> OptionsPageManifestHandler::Keys() const {
221 static const char* keys[] = {keys::kOptionsPage, keys::kOptionsUI}; 222 static const char* keys[] = {keys::kOptionsPage, keys::kOptionsUI};
222 return std::vector<std::string>(keys, keys + arraysize(keys)); 223 return std::vector<std::string>(keys, keys + arraysize(keys));
223 } 224 }
224 225
225 } // namespace extensions 226 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/feature_switch.cc ('k') | extensions/common/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698