| 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 14 matching lines...) Expand all Loading... |
| 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(ConfirmInfoBarDelegate::CreateInfoBar( |
| 35 infobar_service, |
| 35 scoped_ptr<ConfirmInfoBarDelegate>( | 36 scoped_ptr<ConfirmInfoBarDelegate>( |
| 36 new CryptotokenPermissionInfoBarDelegate(message, callback)))); | 37 new CryptotokenPermissionInfoBarDelegate(message, callback)))); |
| 37 } | 38 } |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 CryptotokenPermissionInfoBarDelegate(const base::string16& message, | 41 CryptotokenPermissionInfoBarDelegate(const base::string16& message, |
| 41 const InfoBarCallback& callback) | 42 const InfoBarCallback& callback) |
| 42 : message_(message), callback_(callback), answered_(false) {} | 43 : message_(message), callback_(callback), answered_(false) {} |
| 43 | 44 |
| 44 ~CryptotokenPermissionInfoBarDelegate() override { | 45 ~CryptotokenPermissionInfoBarDelegate() override { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 125 } |
| 125 | 126 |
| 126 void CryptotokenPrivateRequestPermissionFunction::OnInfobarResponse( | 127 void CryptotokenPrivateRequestPermissionFunction::OnInfobarResponse( |
| 127 cryptotoken_private::PermissionResult result) { | 128 cryptotoken_private::PermissionResult result) { |
| 128 Respond(ArgumentList( | 129 Respond(ArgumentList( |
| 129 cryptotoken_private::RequestPermission::Results::Create(result))); | 130 cryptotoken_private::RequestPermission::Results::Create(result))); |
| 130 } | 131 } |
| 131 | 132 |
| 132 } // namespace api | 133 } // namespace api |
| 133 } // namespace extensions | 134 } // namespace extensions |
| OLD | NEW |