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

Side by Side Diff: chrome/browser/extensions/webstore_inline_installer.cc

Issue 2693183002: Allow inline install for user initiated fullscreen mode. (Closed)
Patch Set: Updating to use test extension id. Created 3 years, 10 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 | « no previous file | chrome/browser/extensions/webstore_inline_installer_browsertest.cc » ('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 (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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/webstore_inline_installer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698