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

Unified Diff: chrome/browser/media/midi_permission_infobar_delegate.h

Issue 20990005: Web MIDI: implement permission infobar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable icon for now Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/midi_permission_infobar_delegate.h
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.h b/chrome/browser/media/midi_permission_infobar_delegate.h
similarity index 55%
copy from chrome/browser/geolocation/geolocation_infobar_delegate.h
copy to chrome/browser/media/midi_permission_infobar_delegate.h
index 93a6ab7d8370a0edfb26bc884e85334d94d0a555..2b7c6fe7a261a70ea3ef5bcac5562dfecf83b019 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.h
+++ b/chrome/browser/media/midi_permission_infobar_delegate.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_H_
-#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_H_
+#ifndef CHROME_BROWSER_MEDIA_MIDI_PERMISSION_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_MEDIA_MIDI_PERMISSION_INFOBAR_DELEGATE_H_
#include <string>
@@ -11,15 +11,18 @@
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "url/gurl.h"
+
scherkus (not reviewing) 2013/07/31 18:09:55 remove extra line
Takashi Toyoshima 2013/08/01 08:27:38 Done.
class PermissionQueueController;
class InfoBarService;
-// GeolocationInfoBarDelegates are created by the
-// GeolocationInfoBarQueueController to control the display
-// and handling of geolocation permission infobars to the user.
-class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate {
+// TODO(toyoshim): Much more code can be shared with GeolocationInfoBarDelegate.
scherkus (not reviewing) 2013/07/31 18:09:55 do we have a bug for this?
Takashi Toyoshima 2013/08/01 08:27:38 Done.
+
+// MIDIPermissionInfoBarDelegates are created by the
+// ChromeMIDIPermissionContext to control the display and handling of MIDI
+// permission infobars to the user.
+class MIDIPermissionInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
- // Creates a geolocation infobar delegate and adds it to |infobar_service|.
+ // Creates a infobar delegate and adds it to |infobar_service|.
// Returns the delegate if it was successfully added.
static InfoBarDelegate* Create(InfoBarService* infobar_service,
PermissionQueueController* controller,
@@ -28,19 +31,11 @@ class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate {
const std::string& display_languages);
protected:
- GeolocationInfoBarDelegate(InfoBarService* infobar_service,
- PermissionQueueController* controller,
- const PermissionRequestID& id,
- const GURL& requesting_frame,
- int contents_unique_id,
- const std::string& display_languages);
- virtual ~GeolocationInfoBarDelegate();
-
- // ConfirmInfoBarDelegate:
- virtual bool Accept() OVERRIDE;
-
- // Call back to the controller, to inform of the user's decision.
- void SetPermission(bool update_content_setting, bool allowed);
+ MIDIPermissionInfoBarDelegate(InfoBarService* infobar_service,
+ PermissionQueueController* controller,
+ const PermissionRequestID& id,
+ const GURL& requesting_frame,
+ const std::string& display_languages);
private:
// ConfirmInfoBarDelegate:
@@ -50,17 +45,20 @@ class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate {
const content::LoadCommittedDetails& details) const OVERRIDE;
virtual string16 GetMessageText() const OVERRIDE;
virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
+ virtual bool Accept() OVERRIDE;
virtual bool Cancel() OVERRIDE;
- virtual string16 GetLinkText() const OVERRIDE;
- virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
+ // Call back to the controller, to inform of the user's decision.
scherkus (not reviewing) 2013/07/31 18:09:55 s/Call back/Callback/ s/controller, to/controller
Takashi Toyoshima 2013/08/01 08:27:38 Done.
+ void SetPermission(bool update_content_setting, bool allowed);
+
+ private:
PermissionQueueController* controller_;
const PermissionRequestID id_;
GURL requesting_frame_;
int contents_unique_id_;
std::string display_languages_;
- DISALLOW_COPY_AND_ASSIGN(GeolocationInfoBarDelegate);
+ DISALLOW_COPY_AND_ASSIGN(MIDIPermissionInfoBarDelegate);
};
-#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_H_
+#endif // CHROME_BROWSER_MEDIA_MIDI_PERMISSION_INFOBAR_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698