| OLD | NEW |
| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Called after the manager sends a message to the renderer regarding its | 75 // Called after the manager sends a message to the renderer regarding its |
| 76 // intention to show a prompt. The renderer will send a message back with the | 76 // intention to show a prompt. The renderer will send a message back with the |
| 77 // opportunity to cancel. | 77 // opportunity to cancel. |
| 78 void OnBannerPromptReply(content::RenderFrameHost* render_frame_host, | 78 void OnBannerPromptReply(content::RenderFrameHost* render_frame_host, |
| 79 int request_id, | 79 int request_id, |
| 80 blink::WebAppBannerPromptReply reply); | 80 blink::WebAppBannerPromptReply reply); |
| 81 | 81 |
| 82 // Cancels an active DataFetcher, stopping its banners from appearing. | 82 // Cancels an active DataFetcher, stopping its banners from appearing. |
| 83 void CancelActiveFetcher(); | 83 void CancelActiveFetcher(); |
| 84 | 84 |
| 85 // Queries a field trial for updates to the default number of minutes between |
| 86 // site visits counted for the purposes of displaying a banner. |
| 87 void UpdateMinutesBetweenVisits(); |
| 88 |
| 85 // Ideal icon size to use. | 89 // Ideal icon size to use. |
| 86 const int ideal_icon_size_; | 90 const int ideal_icon_size_; |
| 87 | 91 |
| 88 // The type of navigation made to the page | 92 // The type of navigation made to the page |
| 89 ui::PageTransition last_transition_type_; | 93 ui::PageTransition last_transition_type_; |
| 90 | 94 |
| 91 // Fetches the data required to display a banner for the current page. | 95 // Fetches the data required to display a banner for the current page. |
| 92 scoped_refptr<AppBannerDataFetcher> data_fetcher_; | 96 scoped_refptr<AppBannerDataFetcher> data_fetcher_; |
| 93 | 97 |
| 94 // A weak pointer is used as the lifetime of the ServiceWorkerContext is | 98 // A weak pointer is used as the lifetime of the ServiceWorkerContext is |
| 95 // longer than the lifetime of this banner manager. The banner manager | 99 // longer than the lifetime of this banner manager. The banner manager |
| 96 // might be gone when calls sent to the ServiceWorkerContext are completed. | 100 // might be gone when calls sent to the ServiceWorkerContext are completed. |
| 97 base::WeakPtrFactory<AppBannerManager> weak_factory_; | 101 base::WeakPtrFactory<AppBannerManager> weak_factory_; |
| 98 | 102 |
| 99 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); | 103 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); |
| 100 }; // class AppBannerManager | 104 }; // class AppBannerManager |
| 101 | 105 |
| 102 } // namespace banners | 106 } // namespace banners |
| 103 | 107 |
| 104 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 108 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| OLD | NEW |