| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webstore_inline_installer.h" | 5 #include "chrome/browser/extensions/webstore_inline_installer.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
| 10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 const base::DictionaryValue& webstore_data, | 136 const base::DictionaryValue& webstore_data, |
| 137 std::string* error) const { | 137 std::string* error) const { |
| 138 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); | 138 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
| 139 DCHECK(browser); | 139 DCHECK(browser); |
| 140 if (browser->is_type_popup()) { | 140 if (browser->is_type_popup()) { |
| 141 *error = kInitiatedFromPopupError; | 141 *error = kInitiatedFromPopupError; |
| 142 return false; | 142 return false; |
| 143 } | 143 } |
| 144 FullscreenController* controller = | 144 FullscreenController* controller = |
| 145 browser->exclusive_access_manager()->fullscreen_controller(); | 145 browser->exclusive_access_manager()->fullscreen_controller(); |
| 146 if (controller->IsFullscreenForBrowser() || controller->IsTabFullscreen()) { | 146 if (controller->IsTabFullscreen()) { |
| 147 *error = kInitiatedFromFullscreenError; | 147 *error = kInitiatedFromFullscreenError; |
| 148 return false; | 148 return false; |
| 149 } | 149 } |
| 150 // The store may not support inline installs for this item, in which case | 150 // The store may not support inline installs for this item, in which case |
| 151 // we open the store-provided redirect URL in a new tab and abort the | 151 // we open the store-provided redirect URL in a new tab and abort the |
| 152 // installation process. | 152 // installation process. |
| 153 bool inline_install_not_supported = false; | 153 bool inline_install_not_supported = false; |
| 154 if (webstore_data.HasKey(kInlineInstallNotSupportedKey) | 154 if (webstore_data.HasKey(kInlineInstallNotSupportedKey) |
| 155 && !webstore_data.GetBoolean(kInlineInstallNotSupportedKey, | 155 && !webstore_data.GetBoolean(kInlineInstallNotSupportedKey, |
| 156 &inline_install_not_supported)) { | 156 &inline_install_not_supported)) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << | 245 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << |
| 246 " as URL pattern " << parse_result; | 246 " as URL pattern " << parse_result; |
| 247 return false; | 247 return false; |
| 248 } | 248 } |
| 249 verified_site_pattern.SetScheme("*"); | 249 verified_site_pattern.SetScheme("*"); |
| 250 | 250 |
| 251 return verified_site_pattern.MatchesURL(requestor_url); | 251 return verified_site_pattern.MatchesURL(requestor_url); |
| 252 } | 252 } |
| 253 | 253 |
| 254 } // namespace extensions | 254 } // namespace extensions |
| OLD | NEW |