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

Side by Side Diff: chrome/browser/banners/app_banner_manager_desktop.cc

Issue 2951763003: Implement experimental app banner flow.
Patch Set: Browser test compile Created 3 years, 6 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 | « chrome/browser/banners/app_banner_manager_desktop.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/banners/app_banner_manager_desktop.h" 5 #include "chrome/browser/banners/app_banner_manager_desktop.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/banners/app_banner_infobar_delegate_desktop.h" 10 #include "chrome/browser/banners/app_banner_infobar_delegate_desktop.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 bool AppBannerManagerDesktop::IsWebAppInstalled( 53 bool AppBannerManagerDesktop::IsWebAppInstalled(
54 content::BrowserContext* browser_context, 54 content::BrowserContext* browser_context,
55 const GURL& start_url, 55 const GURL& start_url,
56 const GURL& manifest_url) { 56 const GURL& manifest_url) {
57 return extensions::BookmarkAppHelper::BookmarkOrHostedAppInstalled( 57 return extensions::BookmarkAppHelper::BookmarkOrHostedAppInstalled(
58 browser_context, start_url); 58 browser_context, start_url);
59 } 59 }
60 60
61 void AppBannerManagerDesktop::ShowBanner() { 61 void AppBannerManagerDesktop::ShowBannerUI() {
62 content::WebContents* contents = web_contents(); 62 content::WebContents* contents = web_contents();
63 DCHECK(contents && !manifest_.IsEmpty()); 63 DCHECK(contents && !manifest_.IsEmpty());
64 64
65 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 65 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
66 WebApplicationInfo web_app_info; 66 WebApplicationInfo web_app_info;
67 67
68 bookmark_app_helper_.reset( 68 bookmark_app_helper_.reset(
69 new extensions::BookmarkAppHelper(profile, web_app_info, contents)); 69 new extensions::BookmarkAppHelper(profile, web_app_info, contents));
70 70
71 // This differs from Android, where there is a concrete 71 // This differs from Android, where there is a concrete
(...skipping 29 matching lines...) Expand all
101 double score) { 101 double score) {
102 // Explicitly forbid banners from triggering on navigation unless this is 102 // Explicitly forbid banners from triggering on navigation unless this is
103 // enabled. 103 // enabled.
104 if (!IsEnabled()) 104 if (!IsEnabled())
105 return; 105 return;
106 106
107 AppBannerManager::OnEngagementIncreased(web_contents, url, score); 107 AppBannerManager::OnEngagementIncreased(web_contents, url, score);
108 } 108 }
109 109
110 } // namespace banners 110 } // namespace banners
OLDNEW
« no previous file with comments | « chrome/browser/banners/app_banner_manager_desktop.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698