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

Side by Side Diff: chrome/browser/banners/app_banner_manager.h

Issue 2124243002: Refactor the Java AppBannerManager to be owned by native code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing reviewer comments 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 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 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_
6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 22 matching lines...) Expand all
33 static void DisableSecureSchemeCheckForTesting(); 33 static void DisableSecureSchemeCheckForTesting();
34 34
35 static void SetEngagementWeights(double direct_engagement, 35 static void SetEngagementWeights(double direct_engagement,
36 double indirect_engagement); 36 double indirect_engagement);
37 37
38 // Returns whether or not the URLs match for everything except for the ref. 38 // Returns whether or not the URLs match for everything except for the ref.
39 static bool URLsAreForTheSamePage(const GURL& first, const GURL& second); 39 static bool URLsAreForTheSamePage(const GURL& first, const GURL& second);
40 40
41 // Requests an app banner. Set |is_debug_mode| when it is triggered by the 41 // Requests an app banner. Set |is_debug_mode| when it is triggered by the
42 // developer's action in DevTools. 42 // developer's action in DevTools.
43 void RequestAppBanner(const GURL& validated_url, bool is_debug_mode); 43 virtual void RequestAppBanner(const GURL& validated_url, bool is_debug_mode);
44 44
45 ~AppBannerManager() override; 45 ~AppBannerManager() override;
46 46
47 protected: 47 protected:
48 explicit AppBannerManager(content::WebContents* web_contents); 48 explicit AppBannerManager(content::WebContents* web_contents);
49 49
50 void ReplaceWebContents(content::WebContents* web_contents); 50 void ReplaceWebContents(content::WebContents* web_contents);
pkotwicz 2016/07/13 02:31:50 Drive By! This function seems unused now
51 51
52 // Creates an AppBannerDataFetcher, which constructs an app banner. 52 // Creates an AppBannerDataFetcher, which constructs an app banner.
53 virtual AppBannerDataFetcher* CreateAppBannerDataFetcher( 53 virtual AppBannerDataFetcher* CreateAppBannerDataFetcher(
54 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate, 54 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate,
55 bool is_debug_mode) = 0; 55 bool is_debug_mode) = 0;
56 56
57 // Return whether the AppBannerDataFetcher is active. 57 // Return whether the AppBannerDataFetcher is active.
58 bool IsFetcherActive(); 58 bool IsFetcherActive();
59 59
60 scoped_refptr<AppBannerDataFetcher> data_fetcher() { return data_fetcher_; } 60 scoped_refptr<AppBannerDataFetcher> data_fetcher() { return data_fetcher_; }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // longer than the lifetime of this banner manager. The banner manager 104 // longer than the lifetime of this banner manager. The banner manager
105 // might be gone when calls sent to the ServiceWorkerContext are completed. 105 // might be gone when calls sent to the ServiceWorkerContext are completed.
106 base::WeakPtrFactory<AppBannerManager> weak_factory_; 106 base::WeakPtrFactory<AppBannerManager> weak_factory_;
107 107
108 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); 108 DISALLOW_COPY_AND_ASSIGN(AppBannerManager);
109 }; // class AppBannerManager 109 }; // class AppBannerManager
110 110
111 } // namespace banners 111 } // namespace banners
112 112
113 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ 113 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_web_contents_delegate_android.cc ('k') | chrome/browser/ui/tab_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698