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

Side by Side Diff: chrome/browser/android/media/media_throttle_infobar_delegate.h

Issue 2794283003: Remove MediaThrottler and MediaThrottleInfoBar (Closed)
Patch Set: Deleted Java code Created 3 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_MEDIA_MEDIA_THROTTLE_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_ANDROID_MEDIA_MEDIA_THROTTLE_INFOBAR_DELEGATE_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "components/infobars/core/confirm_infobar_delegate.h"
13
14 namespace content {
15 class WebContents;
16 }
17
18 enum UMAThrottleInfobarResponse {
19 UMA_THROTTLE_INFOBAR_NO_RESPONSE,
20 UMA_THROTTLE_INFOBAR_TRY_AGAIN,
21 UMA_THROTTLE_INFOBAR_WAIT,
22 UMA_THROTTLE_INFOBAR_DISMISSED,
23 // NOTE: Add responses only immediately above this line. Make sure to
24 // update the enum list in tools/metrics/histograms/histograms.xml
25 // accordingly.
26 UMA_THROTTLE_INFOBAR_RESPONSE_COUNT
27 };
28
29 class MediaThrottleInfoBarDelegate : public ConfirmInfoBarDelegate {
30 public:
31 typedef base::Callback<void(bool)> DecodeRequestGrantedCallback;
32 ~MediaThrottleInfoBarDelegate() override;
33
34 // Static method to create the object
35 static void Create(
36 content::WebContents* web_contents,
37 const DecodeRequestGrantedCallback& callback);
38
39 private:
40 explicit MediaThrottleInfoBarDelegate(
41 const DecodeRequestGrantedCallback& callback);
42
43 // ConfirmInfoBarDelegate:
44 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
45 MediaThrottleInfoBarDelegate* AsMediaThrottleInfoBarDelegate() override;
46 base::string16 GetMessageText() const override;
47 int GetIconId() const override;
48 base::string16 GetButtonLabel(InfoBarButton button) const override;
49 bool Accept() override;
50 bool Cancel() override;
51 void InfoBarDismissed() override;
52
53 UMAThrottleInfobarResponse infobar_response_;
54
55 DecodeRequestGrantedCallback decode_granted_callback_;
56
57 DISALLOW_COPY_AND_ASSIGN(MediaThrottleInfoBarDelegate);
58 };
59
60 #endif // CHROME_BROWSER_ANDROID_MEDIA_MEDIA_THROTTLE_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698