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

Side by Side Diff: chrome/browser/wake_lock/wake_lock_infobar_delegate.h

Issue 406483004: Initial implementation of API WakeLock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
(Empty)
1 // Copyright (c) 2014 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_WAKE_LOCK_WAKE_LOCK_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_WAKE_LOCK_WAKE_LOCK_INFOBAR_DELEGATE_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "chrome/browser/content_settings/permission_request_id.h"
12 #include "components/infobars/core/confirm_infobar_delegate.h"
13 #include "url/gurl.h"
14
15 class InfoBarService;
16
17 class WakeLockInfoBarDelegate : public ConfirmInfoBarDelegate {
18 public:
19 typedef base::Callback<void(bool allowed)> WakeLockCallback;
20
21 static infobars::InfoBar* Create(InfoBarService* infobar_service,
22 int render_process_id,
23 int routed_id,
24 WakeLockCallback callback);
25
26 private:
27 WakeLockInfoBarDelegate(int render_process_id,
28 int routed_id,
29 const std::string& url,
30 WakeLockCallback callback);
31 virtual ~WakeLockInfoBarDelegate();
32
33 // ConfirmInfoBarDelegate:
34 virtual bool Accept() OVERRIDE;
35 virtual bool Cancel() OVERRIDE;
36 virtual void InfoBarDismissed() OVERRIDE;
37 virtual int GetIconID() const OVERRIDE;
38 virtual Type GetInfoBarType() const OVERRIDE;
39 virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
40 virtual base::string16 GetMessageText() const OVERRIDE;
41
42 void set_user_has_interacted() {
43 user_has_interacted_ = true;
44 }
45 void SetPermission(bool update_content_setting, bool allowed);
46
47 bool user_has_interacted_;
48 int render_process_id_;
49 int routed_id_;
50 std::string url_;
51 WakeLockCallback callback_;
52
53 DISALLOW_COPY_AND_ASSIGN(WakeLockInfoBarDelegate);
54 };
55
56 #endif // CHROME_BROWSER_WAKE_LOCK_WAKE_LOCK_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698