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

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

Issue 1161233005: Implement app banner info bars on desktop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stop-icon-overgeneration
Patch Set: Moving feature enabling to existing #ifs Created 5 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
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 "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 26 matching lines...) Expand all
37 static bool URLsAreForTheSamePage(const GURL& first, const GURL& second); 37 static bool URLsAreForTheSamePage(const GURL& first, const GURL& second);
38 38
39 explicit AppBannerManager(int icon_size); 39 explicit AppBannerManager(int icon_size);
40 ~AppBannerManager() override; 40 ~AppBannerManager() override;
41 41
42 // WebContentsObserver overrides. 42 // WebContentsObserver overrides.
43 void DidFinishLoad(content::RenderFrameHost* render_frame_host, 43 void DidFinishLoad(content::RenderFrameHost* render_frame_host,
44 const GURL& validated_url) override; 44 const GURL& validated_url) override;
45 45
46 protected: 46 protected:
47 AppBannerManager(content::WebContents* web_contents, int icon_size);
48
47 void ReplaceWebContents(content::WebContents* web_contents); 49 void ReplaceWebContents(content::WebContents* web_contents);
48 50
49 // Creates an AppBannerDataFetcher, which constructs an app banner. 51 // Creates an AppBannerDataFetcher, which constructs an app banner.
50 virtual AppBannerDataFetcher* CreateAppBannerDataFetcher( 52 virtual AppBannerDataFetcher* CreateAppBannerDataFetcher(
51 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate, 53 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate,
52 const int ideal_icon_size); 54 const int ideal_icon_size) = 0;
53 55
54 // Return whether the AppBannerDataFetcher is active. 56 // Return whether the AppBannerDataFetcher is active.
55 bool IsFetcherActive(); 57 bool IsFetcherActive();
56 58
57 scoped_refptr<AppBannerDataFetcher> data_fetcher() { return data_fetcher_; } 59 scoped_refptr<AppBannerDataFetcher> data_fetcher() { return data_fetcher_; }
58 int ideal_icon_size() { return ideal_icon_size_; } 60 int ideal_icon_size() { return ideal_icon_size_; }
59 61
60 private: 62 private:
61 // AppBannerDataFetcher::Delegate overrides. 63 // AppBannerDataFetcher::Delegate overrides.
62 bool HandleNonWebApp(const std::string& platform, 64 bool HandleNonWebApp(const std::string& platform,
(...skipping 20 matching lines...) Expand all
83 // longer than the lifetime of this banner manager. The banner manager 85 // longer than the lifetime of this banner manager. The banner manager
84 // might be gone when calls sent to the ServiceWorkerContext are completed. 86 // might be gone when calls sent to the ServiceWorkerContext are completed.
85 base::WeakPtrFactory<AppBannerManager> weak_factory_; 87 base::WeakPtrFactory<AppBannerManager> weak_factory_;
86 88
87 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); 89 DISALLOW_COPY_AND_ASSIGN(AppBannerManager);
88 }; // class AppBannerManager 90 }; // class AppBannerManager
89 91
90 } // namespace banners 92 } // namespace banners
91 93
92 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ 94 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/banners/app_banner_infobar_delegate_desktop.cc ('k') | chrome/browser/banners/app_banner_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698