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

Unified Diff: chrome/browser/extensions/tab_helper.cc

Issue 667053007: Use manifest for streamlined hosted app creation for title and URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Fix memory leak in manifest_manager_host Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/tab_helper.cc
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc
index 4b0417d750f803225b013a296bffccb7401ed4ad..38a08c41f07f07e1b254e1b80c96676608f8255a 100644
--- a/chrome/browser/extensions/tab_helper.cc
+++ b/chrome/browser/extensions/tab_helper.cc
@@ -119,6 +119,9 @@ TabHelper::~TabHelper() {
void TabHelper::CreateApplicationShortcuts() {
DCHECK(CanCreateApplicationShortcuts());
+ if (pending_web_app_action_ != NONE)
+ return;
+
// Start fetching web app info for CreateApplicationShortcut dialog and show
// the dialog when the data is available in OnDidGetApplicationInfo.
GetApplicationInfo(CREATE_SHORTCUT);
@@ -126,6 +129,9 @@ void TabHelper::CreateApplicationShortcuts() {
void TabHelper::CreateHostedAppFromWebContents() {
DCHECK(CanCreateBookmarkApp());
+ if (pending_web_app_action_ != NONE)
+ return;
+
// Start fetching web app info for CreateApplicationShortcut dialog and show
// the dialog when the data is available in OnDidGetApplicationInfo.
GetApplicationInfo(CREATE_HOSTED_APP);
@@ -135,8 +141,7 @@ bool TabHelper::CanCreateApplicationShortcuts() const {
#if defined(OS_MACOSX)
return false;
#else
- return web_app::IsValidUrl(web_contents()->GetURL()) &&
- pending_web_app_action_ == NONE;
+ return web_app::IsValidUrl(web_contents()->GetURL());
#endif
}
@@ -144,8 +149,7 @@ bool TabHelper::CanCreateBookmarkApp() const {
#if defined(OS_MACOSX)
return false;
#else
- return IsValidBookmarkAppUrl(web_contents()->GetURL()) &&
- pending_web_app_action_ == NONE;
+ return IsValidBookmarkAppUrl(web_contents()->GetURL());
#endif
}
« no previous file with comments | « chrome/browser/extensions/bookmark_app_helper_unittest.cc ('k') | content/browser/manifest/manifest_manager_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698