OLD | NEW |
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/extensions/api/cryptotoken_private/cryptotoken_private_
api.h" | 5 #include "chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_
api.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
10 #include "chrome/browser/extensions/extension_tab_util.h" | 10 #include "chrome/browser/extensions/extension_tab_util.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace { | 24 namespace { |
25 | 25 |
26 class CryptotokenPermissionInfoBarDelegate : public ConfirmInfoBarDelegate { | 26 class CryptotokenPermissionInfoBarDelegate : public ConfirmInfoBarDelegate { |
27 public: | 27 public: |
28 typedef base::Callback<void(cryptotoken_private::PermissionResult)> | 28 typedef base::Callback<void(cryptotoken_private::PermissionResult)> |
29 InfoBarCallback; | 29 InfoBarCallback; |
30 | 30 |
31 static void Create(InfoBarService* infobar_service, | 31 static void Create(InfoBarService* infobar_service, |
32 const base::string16& message, | 32 const base::string16& message, |
33 const InfoBarCallback& callback) { | 33 const InfoBarCallback& callback) { |
34 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 34 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( |
35 scoped_ptr<ConfirmInfoBarDelegate>( | 35 scoped_ptr<ConfirmInfoBarDelegate>( |
36 new CryptotokenPermissionInfoBarDelegate(message, callback)))); | 36 new CryptotokenPermissionInfoBarDelegate(message, callback)))); |
37 } | 37 } |
38 | 38 |
39 private: | 39 private: |
40 CryptotokenPermissionInfoBarDelegate(const base::string16& message, | 40 CryptotokenPermissionInfoBarDelegate(const base::string16& message, |
41 const InfoBarCallback& callback) | 41 const InfoBarCallback& callback) |
42 : message_(message), callback_(callback), answered_(false) {} | 42 : message_(message), callback_(callback), answered_(false) {} |
43 | 43 |
44 ~CryptotokenPermissionInfoBarDelegate() override { | 44 ~CryptotokenPermissionInfoBarDelegate() override { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 | 125 |
126 void CryptotokenPrivateRequestPermissionFunction::OnInfobarResponse( | 126 void CryptotokenPrivateRequestPermissionFunction::OnInfobarResponse( |
127 cryptotoken_private::PermissionResult result) { | 127 cryptotoken_private::PermissionResult result) { |
128 Respond(ArgumentList( | 128 Respond(ArgumentList( |
129 cryptotoken_private::RequestPermission::Results::Create(result))); | 129 cryptotoken_private::RequestPermission::Results::Create(result))); |
130 } | 130 } |
131 | 131 |
132 } // namespace api | 132 } // namespace api |
133 } // namespace extensions | 133 } // namespace extensions |
OLD | NEW |