| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 const base::DictionaryValue& webstore_data, | 177 const base::DictionaryValue& webstore_data, |
| 178 std::string* error) const { | 178 std::string* error) const { |
| 179 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); | 179 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
| 180 DCHECK(browser); | 180 DCHECK(browser); |
| 181 if (browser->is_type_popup()) { | 181 if (browser->is_type_popup()) { |
| 182 *error = kInitiatedFromPopupError; | 182 *error = kInitiatedFromPopupError; |
| 183 return false; | 183 return false; |
| 184 } | 184 } |
| 185 FullscreenController* controller = | 185 FullscreenController* controller = |
| 186 browser->exclusive_access_manager()->fullscreen_controller(); | 186 browser->exclusive_access_manager()->fullscreen_controller(); |
| 187 if (controller->IsFullscreenForBrowser() || controller->IsTabFullscreen()) { | 187 if (controller->IsTabFullscreen()) { |
| 188 *error = kInitiatedFromFullscreenError; | 188 *error = kInitiatedFromFullscreenError; |
| 189 return false; | 189 return false; |
| 190 } | 190 } |
| 191 // The store may not support inline installs for this item, in which case | 191 // The store may not support inline installs for this item, in which case |
| 192 // we open the store-provided redirect URL in a new tab and abort the | 192 // we open the store-provided redirect URL in a new tab and abort the |
| 193 // installation process. | 193 // installation process. |
| 194 bool inline_install_not_supported = false; | 194 bool inline_install_not_supported = false; |
| 195 if (webstore_data.HasKey(kInlineInstallNotSupportedKey) | 195 if (webstore_data.HasKey(kInlineInstallNotSupportedKey) |
| 196 && !webstore_data.GetBoolean(kInlineInstallNotSupportedKey, | 196 && !webstore_data.GetBoolean(kInlineInstallNotSupportedKey, |
| 197 &inline_install_not_supported)) { | 197 &inline_install_not_supported)) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << | 287 DLOG(WARNING) << "Could not parse " << verified_site_pattern_spec << |
| 288 " as URL pattern " << parse_result; | 288 " as URL pattern " << parse_result; |
| 289 return false; | 289 return false; |
| 290 } | 290 } |
| 291 verified_site_pattern.SetScheme("*"); | 291 verified_site_pattern.SetScheme("*"); |
| 292 | 292 |
| 293 return verified_site_pattern.MatchesURL(requestor_url); | 293 return verified_site_pattern.MatchesURL(requestor_url); |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace extensions | 296 } // namespace extensions |
| OLD | NEW |