| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa_controller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa_controller.h" |
| 6 | 6 |
| 7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
| 8 #include "chrome/browser/chooser_controller/chooser_controller.h" | 8 #include "chrome/browser/chooser_controller/chooser_controller.h" |
| 9 #import "chrome/browser/ui/cocoa/chooser_content_view_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/chooser_content_view_cocoa.h" |
| 10 #import "chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa.h" | 10 #import "chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 - (CGFloat)tableView:(NSTableView*)tableView heightOfRow:(NSInteger)row { | 60 - (CGFloat)tableView:(NSTableView*)tableView heightOfRow:(NSInteger)row { |
| 61 return [chooserContentView_ tableRowViewHeight:row]; | 61 return [chooserContentView_ tableRowViewHeight:row]; |
| 62 } | 62 } |
| 63 | 63 |
| 64 - (void)tableViewSelectionDidChange:(NSNotification*)aNotification { | 64 - (void)tableViewSelectionDidChange:(NSNotification*)aNotification { |
| 65 [chooserContentView_ updateContentRowColor]; | 65 [chooserContentView_ updateContentRowColor]; |
| 66 [connectButton_ setEnabled:[tableView_ numberOfSelectedRows] > 0]; | 66 [connectButton_ setEnabled:[tableView_ numberOfSelectedRows] > 0]; |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Selection changes (while the mouse button is still down). |
| 70 - (void)tableViewSelectionIsChanging:(NSNotification*)aNotification { |
| 71 [chooserContentView_ updateContentRowColor]; |
| 72 [connectButton_ setEnabled:[tableView_ numberOfSelectedRows] > 0]; |
| 73 } |
| 74 |
| 69 - (void)onConnect:(id)sender { | 75 - (void)onConnect:(id)sender { |
| 70 [chooserContentView_ accept]; | 76 [chooserContentView_ accept]; |
| 71 chooserDialogCocoa_->Dismissed(); | 77 chooserDialogCocoa_->Dismissed(); |
| 72 } | 78 } |
| 73 | 79 |
| 74 - (void)onCancel:(id)sender { | 80 - (void)onCancel:(id)sender { |
| 75 [chooserContentView_ cancel]; | 81 [chooserContentView_ cancel]; |
| 76 chooserDialogCocoa_->Dismissed(); | 82 chooserDialogCocoa_->Dismissed(); |
| 77 } | 83 } |
| 78 | 84 |
| 79 - (ChooserContentViewCocoa*)chooserContentView { | 85 - (ChooserContentViewCocoa*)chooserContentView { |
| 80 return chooserContentView_.get(); | 86 return chooserContentView_.get(); |
| 81 } | 87 } |
| 82 | 88 |
| 83 @end | 89 @end |
| OLD | NEW |