| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 // Called after the manager sends a message to the renderer regarding its | 262 // Called after the manager sends a message to the renderer regarding its |
| 263 // intention to show a prompt. The renderer will send a message back with the | 263 // intention to show a prompt. The renderer will send a message back with the |
| 264 // opportunity to cancel. | 264 // opportunity to cancel. |
| 265 void OnBannerPromptReply(blink::mojom::AppBannerPromptReply reply, | 265 void OnBannerPromptReply(blink::mojom::AppBannerPromptReply reply, |
| 266 const std::string& referrer); | 266 const std::string& referrer); |
| 267 | 267 |
| 268 // blink::mojom::AppBannerService overrides. | 268 // blink::mojom::AppBannerService overrides. |
| 269 // Called when Blink has prevented a banner from being shown, and is now | 269 // Called when Blink has prevented a banner from being shown, and is now |
| 270 // requesting that it be shown later. | 270 // requesting that it be shown later. |
| 271 void DisplayAppBanner() override; | 271 void DisplayAppBanner(bool user_gesture) override; |
| 272 | 272 |
| 273 // Fetches the data required to display a banner for the current page. | 273 // Fetches the data required to display a banner for the current page. |
| 274 InstallableManager* manager_; | 274 InstallableManager* manager_; |
| 275 | 275 |
| 276 // A monotonically increasing id to verify the response to the | 276 // A monotonically increasing id to verify the response to the |
| 277 // beforeinstallprompt event from the renderer. | 277 // beforeinstallprompt event from the renderer. |
| 278 int event_request_id_; | 278 int event_request_id_; |
| 279 | 279 |
| 280 // We do not want to trigger a banner when the manager is attached to | 280 // We do not want to trigger a banner when the manager is attached to |
| 281 // a WebContents that is playing video. Banners triggering on a site in the | 281 // a WebContents that is playing video. Banners triggering on a site in the |
| (...skipping 23 matching lines...) Expand all Loading... |
| 305 // scoped to the WebContents which they are observing. This allows us to use | 305 // scoped to the WebContents which they are observing. This allows us to use |
| 306 // weak pointers for callbacks. | 306 // weak pointers for callbacks. |
| 307 base::WeakPtrFactory<AppBannerManager> weak_factory_; | 307 base::WeakPtrFactory<AppBannerManager> weak_factory_; |
| 308 | 308 |
| 309 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); | 309 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); |
| 310 }; | 310 }; |
| 311 | 311 |
| 312 } // namespace banners | 312 } // namespace banners |
| 313 | 313 |
| 314 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 314 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| OLD | NEW |