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

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

Issue 8885022: Move URLPattern::ParseOption into a field. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more minor sprucing Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } 290 }
291 291
292 // Verified site is required 292 // Verified site is required
293 if (webstore_data->HasKey(kVerifiedSiteKey)) { 293 if (webstore_data->HasKey(kVerifiedSiteKey)) {
294 std::string verified_site_domain; 294 std::string verified_site_domain;
295 if (!webstore_data->GetString(kVerifiedSiteKey, &verified_site_domain)) { 295 if (!webstore_data->GetString(kVerifiedSiteKey, &verified_site_domain)) {
296 CompleteInstall(kInvalidWebstoreResponseError); 296 CompleteInstall(kInvalidWebstoreResponseError);
297 return; 297 return;
298 } 298 }
299 299
300 URLPattern verified_site_pattern(URLPattern::SCHEME_ALL); 300 URLPattern verified_site_pattern(URLPattern::ERROR_ON_PORTS,
301 URLPattern::SCHEME_ALL);
301 verified_site_pattern.SetScheme("*"); 302 verified_site_pattern.SetScheme("*");
302 verified_site_pattern.SetHost(verified_site_domain); 303 verified_site_pattern.SetHost(verified_site_domain);
303 verified_site_pattern.SetMatchSubdomains(true); 304 verified_site_pattern.SetMatchSubdomains(true);
304 verified_site_pattern.SetPath("/*"); 305 verified_site_pattern.SetPath("/*");
305 306
306 if (!verified_site_pattern.MatchesURL(requestor_url_)) { 307 if (!verified_site_pattern.MatchesURL(requestor_url_)) {
307 CompleteInstall(kNotFromVerifiedSiteError); 308 CompleteInstall(kNotFromVerifiedSiteError);
308 return; 309 return;
309 } 310 }
310 } else { 311 } else {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 if (tab_contents()) { 428 if (tab_contents()) {
428 if (error.empty()) { 429 if (error.empty()) {
429 delegate_->OnInlineInstallSuccess(install_id_); 430 delegate_->OnInlineInstallSuccess(install_id_);
430 } else { 431 } else {
431 delegate_->OnInlineInstallFailure(install_id_, error); 432 delegate_->OnInlineInstallFailure(install_id_, error);
432 } 433 }
433 } 434 }
434 435
435 Release(); // Matches the AddRef in BeginInstall. 436 Release(); // Matches the AddRef in BeginInstall.
436 } 437 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/user_script_master.cc ('k') | chrome/browser/tab_contents/render_view_context_menu_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698