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

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

Issue 2064943002: Pass in extra parameters to WebApkBuilder#buildWebApkAsync() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_manifest000 Created 4 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bookmark_app_helper.h" 5 #include "chrome/browser/extensions/bookmark_app_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cctype> 9 #include <cctype>
10 #include <string> 10 #include <string>
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 } 564 }
565 } 565 }
566 566
567 void BookmarkAppHelper::CreateFromAppBanner( 567 void BookmarkAppHelper::CreateFromAppBanner(
568 const CreateBookmarkAppCallback& callback, 568 const CreateBookmarkAppCallback& callback,
569 const content::Manifest& manifest) { 569 const content::Manifest& manifest) {
570 DCHECK(!manifest.short_name.is_null() || !manifest.name.is_null()); 570 DCHECK(!manifest.short_name.is_null() || !manifest.name.is_null());
571 DCHECK(manifest.start_url.is_valid()); 571 DCHECK(manifest.start_url.is_valid());
572 572
573 callback_ = callback; 573 callback_ = callback;
574 OnDidGetManifest(manifest); 574 OnDidGetManifest(GURL(), manifest);
575 } 575 }
576 576
577 void BookmarkAppHelper::OnDidGetManifest(const content::Manifest& manifest) { 577 void BookmarkAppHelper::OnDidGetManifest(const GURL& manifest_url,
578 const content::Manifest& manifest) {
578 if (contents_->IsBeingDestroyed()) 579 if (contents_->IsBeingDestroyed())
579 return; 580 return;
580 581
581 UpdateWebAppInfoFromManifest(manifest, &web_app_info_); 582 UpdateWebAppInfoFromManifest(manifest, &web_app_info_);
582 583
583 // Add urls from the WebApplicationInfo. 584 // Add urls from the WebApplicationInfo.
584 std::vector<GURL> web_app_info_icon_urls; 585 std::vector<GURL> web_app_info_icon_urls;
585 for (std::vector<WebApplicationInfo::IconInfo>::const_iterator it = 586 for (std::vector<WebApplicationInfo::IconInfo>::const_iterator it =
586 web_app_info_.icons.begin(); 587 web_app_info_.icons.begin();
587 it != web_app_info_.icons.end(); 588 it != web_app_info_.icons.end();
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); 797 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback));
797 } 798 }
798 799
799 bool IsValidBookmarkAppUrl(const GURL& url) { 800 bool IsValidBookmarkAppUrl(const GURL& url) {
800 URLPattern origin_only_pattern(Extension::kValidBookmarkAppSchemes); 801 URLPattern origin_only_pattern(Extension::kValidBookmarkAppSchemes);
801 origin_only_pattern.SetMatchAllURLs(true); 802 origin_only_pattern.SetMatchAllURLs(true);
802 return url.is_valid() && origin_only_pattern.MatchesURL(url); 803 return url.is_valid() && origin_only_pattern.MatchesURL(url);
803 } 804 }
804 805
805 } // namespace extensions 806 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/bookmark_app_helper.h ('k') | chrome/browser/extensions/bookmark_app_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698