| Index: chrome/browser/extensions/extension_tabs_module.cc
|
| diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
|
| index bf40f57dfd0080acbe758e307eb7221d9f0c08c1..ac6876356d262ef90f8e91fcd20e29e3360ddab8 100644
|
| --- a/chrome/browser/extensions/extension_tabs_module.cc
|
| +++ b/chrome/browser/extensions/extension_tabs_module.cc
|
| @@ -387,17 +387,17 @@ bool CreateWindowFunction::RunImpl() {
|
| panel_bounds.set_height(bounds_val);
|
| }
|
|
|
| + const IncognitoModePrefs::Availability incognito_availability =
|
| + IncognitoModePrefs::GetAvailability(profile_->GetPrefs());
|
| bool incognito = false;
|
| if (args->HasKey(keys::kIncognitoKey)) {
|
| EXTENSION_FUNCTION_VALIDATE(args->GetBoolean(keys::kIncognitoKey,
|
| &incognito));
|
| - if (IncognitoModePrefs::GetAvailability(profile_->GetPrefs()) ==
|
| - IncognitoModePrefs::DISABLED) {
|
| - error_ = keys::kIncognitoModeIsDisabled;
|
| - return false;
|
| - }
|
| -
|
| if (incognito) {
|
| + if (incognito_availability == IncognitoModePrefs::DISABLED) {
|
| + error_ = keys::kIncognitoModeIsDisabled;
|
| + return false;
|
| + }
|
| std::string first_url_erased;
|
| // Guest session is an exception as it always opens in incognito mode.
|
| for (size_t i = 0; i < urls.size();) {
|
| @@ -418,6 +418,10 @@ bool CreateWindowFunction::RunImpl() {
|
| window_profile = window_profile->GetOffTheRecordProfile();
|
| }
|
| }
|
| + if (!incognito && incognito_availability == IncognitoModePrefs::FORCED) {
|
| + error_ = keys::kIncognitoModeIsForced;
|
| + return false;
|
| + }
|
|
|
| if (args->HasKey(keys::kFocusedKey)) {
|
| EXTENSION_FUNCTION_VALIDATE(args->GetBoolean(keys::kFocusedKey,
|
|
|