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

Side by Side Diff: chrome/browser/services/gcm/push_messaging_infobar_delegate.cc

Issue 365123003: Implement midi permissions on top of the new common permission classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "chrome/browser/services/gcm/push_messaging_infobar_delegate.h" 5 #include "chrome/browser/services/gcm/push_messaging_infobar_delegate.h"
6 6
7 #include "components/infobars/core/infobar.h" 7 #include "components/infobars/core/infobar.h"
8 #include "grit/generated_resources.h" 8 #include "grit/generated_resources.h"
9 #include "grit/theme_resources.h"
9 #include "net/base/net_util.h" 10 #include "net/base/net_util.h"
10 #include "ui/base/l10n/l10n_util.h" 11 #include "ui/base/l10n/l10n_util.h"
11 12
12 namespace gcm { 13 namespace gcm {
13 14
14 // static 15 // static
15 infobars::InfoBar* PushMessagingInfoBarDelegate::Create( 16 infobars::InfoBar* PushMessagingInfoBarDelegate::Create(
16 InfoBarService* infobar_service, 17 InfoBarService* infobar_service,
17 PermissionQueueController* controller, 18 PermissionQueueController* controller,
18 const PermissionRequestID& id, 19 const PermissionRequestID& id,
(...skipping 14 matching lines...) Expand all
33 : PermissionInfobarDelegate(controller, id, requesting_frame), 34 : PermissionInfobarDelegate(controller, id, requesting_frame),
34 requesting_origin_(requesting_frame.GetOrigin()), 35 requesting_origin_(requesting_frame.GetOrigin()),
35 display_languages_(display_languages) { 36 display_languages_(display_languages) {
36 } 37 }
37 38
38 PushMessagingInfoBarDelegate::~PushMessagingInfoBarDelegate() { 39 PushMessagingInfoBarDelegate::~PushMessagingInfoBarDelegate() {
39 } 40 }
40 41
41 base::string16 PushMessagingInfoBarDelegate::GetMessageText() const { 42 base::string16 PushMessagingInfoBarDelegate::GetMessageText() const {
42 return l10n_util::GetStringFUTF16( 43 return l10n_util::GetStringFUTF16(
43 IDS_PUSH_MESSAGES_PERMISSION_QUESTION, 44 IDS_PUSH_MESSAGES_PERMISSION_QUESTION,
44 net::FormatUrl(requesting_origin_, display_languages_)); 45 net::FormatUrl(requesting_origin_, display_languages_,
46 net::kFormatUrlOmitUsernamePassword |
47 net::kFormatUrlOmitTrailingSlashOnBareHostname,
48 net::UnescapeRule::SPACES, NULL, NULL, NULL));
49 }
50
51 int PushMessagingInfoBarDelegate::GetIconID() const {
52 // TODO(miguelg): change once we have an icon
53 return IDR_INFOBAR_WARNING;
45 } 54 }
46 55
47 } // namespace gcm 56 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698