| 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 #import "base/mac/bundle_locations.h" | 5 #import "base/mac/bundle_locations.h" |
| 6 #include "base/strings/sys_string_conversions.h" | 6 #include "base/strings/sys_string_conversions.h" |
| 7 #import "chrome/browser/ui/cocoa/extensions/device_permissions_dialog_controller
.h" | 7 #import "chrome/browser/ui/cocoa/extensions/device_permissions_dialog_controller
.h" |
| 8 #import "chrome/browser/ui/cocoa/extensions/device_permissions_view_controller.h
" | 8 #import "chrome/browser/ui/cocoa/extensions/device_permissions_view_controller.h
" |
| 9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
| 10 #import "ui/base/l10n/l10n_util_mac.h" | 10 #import "ui/base/l10n/l10n_util_mac.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 prompt_ = prompt; | 22 prompt_ = prompt; |
| 23 } | 23 } |
| 24 return self; | 24 return self; |
| 25 } | 25 } |
| 26 | 26 |
| 27 - (IBAction)cancel:(id)sender { | 27 - (IBAction)cancel:(id)sender { |
| 28 controller_->Dismissed(); | 28 controller_->Dismissed(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 - (IBAction)ok:(id)sender { | 31 - (IBAction)ok:(id)sender { |
| 32 __block std::vector<scoped_refptr<device::UsbDevice>> devices; | |
| 33 [[tableView_ selectedRowIndexes] | 32 [[tableView_ selectedRowIndexes] |
| 34 enumerateIndexesUsingBlock:^(NSUInteger index, BOOL* stop) { | 33 enumerateIndexesUsingBlock:^(NSUInteger index, BOOL* stop) { |
| 35 prompt_->GrantDevicePermission(index); | 34 prompt_->GrantDevicePermission(index); |
| 36 }]; | 35 }]; |
| 37 controller_->Dismissed(); | 36 controller_->Dismissed(); |
| 38 } | 37 } |
| 39 | 38 |
| 40 - (void)devicesChanged { | 39 - (void)devicesChanged { |
| 41 [tableView_ reloadData]; | 40 [tableView_ reloadData]; |
| 42 } | 41 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 69 return base::SysUTF16ToNSString(prompt_->GetDeviceName(rowIndex)); | 68 return base::SysUTF16ToNSString(prompt_->GetDeviceName(rowIndex)); |
| 70 } else if (tableColumn == serialNumberColumn_) { | 69 } else if (tableColumn == serialNumberColumn_) { |
| 71 return base::SysUTF16ToNSString(prompt_->GetDeviceSerialNumber(rowIndex)); | 70 return base::SysUTF16ToNSString(prompt_->GetDeviceSerialNumber(rowIndex)); |
| 72 } else { | 71 } else { |
| 73 NOTREACHED(); | 72 NOTREACHED(); |
| 74 return @""; | 73 return @""; |
| 75 } | 74 } |
| 76 } | 75 } |
| 77 | 76 |
| 78 @end | 77 @end |
| OLD | NEW |