| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/website_settings/chooser_bubble_ui_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 - (void)updateTableView { | 207 - (void)updateTableView { |
| 208 [chooserContentView_ updateTableView]; | 208 [chooserContentView_ updateTableView]; |
| 209 } | 209 } |
| 210 | 210 |
| 211 - (void)tableViewSelectionDidChange:(NSNotification*)aNotification { | 211 - (void)tableViewSelectionDidChange:(NSNotification*)aNotification { |
| 212 [chooserContentView_ updateContentRowColor]; | 212 [chooserContentView_ updateContentRowColor]; |
| 213 [connectButton_ setEnabled:[tableView_ numberOfSelectedRows] > 0]; | 213 [connectButton_ setEnabled:[tableView_ numberOfSelectedRows] > 0]; |
| 214 } | 214 } |
| 215 | 215 |
| 216 // Selection changes (while the mouse button is still down). |
| 217 - (void)tableViewSelectionIsChanging:(NSNotification*)aNotification { |
| 218 [chooserContentView_ updateContentRowColor]; |
| 219 [connectButton_ setEnabled:[tableView_ numberOfSelectedRows] > 0]; |
| 220 } |
| 221 |
| 216 - (void)updateAnchorPosition { | 222 - (void)updateAnchorPosition { |
| 217 [self setParentWindow:[self getExpectedParentWindow]]; | 223 [self setParentWindow:[self getExpectedParentWindow]]; |
| 218 [self setAnchorPoint:[self getExpectedAnchorPoint]]; | 224 [self setAnchorPoint:[self getExpectedAnchorPoint]]; |
| 219 } | 225 } |
| 220 | 226 |
| 221 - (NSPoint)getExpectedAnchorPoint { | 227 - (NSPoint)getExpectedAnchorPoint { |
| 222 NSPoint anchor; | 228 NSPoint anchor; |
| 223 if ([self hasLocationBar]) { | 229 if ([self hasLocationBar]) { |
| 224 LocationBarViewMac* locationBar = | 230 LocationBarViewMac* locationBar = |
| 225 [[[self getExpectedParentWindow] windowController] locationBarBridge]; | 231 [[[self getExpectedParentWindow] windowController] locationBarBridge]; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 } | 322 } |
| 317 | 323 |
| 318 void ChooserBubbleUiCocoa::UpdateAnchorPosition() { | 324 void ChooserBubbleUiCocoa::UpdateAnchorPosition() { |
| 319 if (chooser_bubble_ui_controller_) | 325 if (chooser_bubble_ui_controller_) |
| 320 [chooser_bubble_ui_controller_ updateAnchorPosition]; | 326 [chooser_bubble_ui_controller_ updateAnchorPosition]; |
| 321 } | 327 } |
| 322 | 328 |
| 323 void ChooserBubbleUiCocoa::OnBubbleClosing() { | 329 void ChooserBubbleUiCocoa::OnBubbleClosing() { |
| 324 chooser_bubble_ui_controller_ = nil; | 330 chooser_bubble_ui_controller_ = nil; |
| 325 } | 331 } |
| OLD | NEW |