| 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 "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.
h" | 5 #import "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.
h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/mac/bind_objc_block.h" | 9 #include "base/mac/bind_objc_block.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 - (void)windowWillClose:(NSNotification*)notification { | 275 - (void)windowWillClose:(NSNotification*)notification { |
| 276 [[NSNotificationCenter defaultCenter] | 276 [[NSNotificationCenter defaultCenter] |
| 277 removeObserver:self | 277 removeObserver:self |
| 278 name:NSWindowDidMoveNotification | 278 name:NSWindowDidMoveNotification |
| 279 object:nil]; | 279 object:nil]; |
| 280 bridge_->OnBubbleClosing(); | 280 bridge_->OnBubbleClosing(); |
| 281 [super windowWillClose:notification]; | 281 [super windowWillClose:notification]; |
| 282 } | 282 } |
| 283 | 283 |
| 284 - (void)showWindow:(id)sender { | 284 - (void)showWindow:(id)sender { |
| 285 if ([self hasVisibleLocationBar]) { | 285 LocationBarViewMac* bridge = |
| 286 decoration_ = [[self.parentWindow windowController] locationBarBridge] | 286 [[self.parentWindow windowController] locationBarBridge]; |
| 287 ->GetPageInfoDecoration(); | 287 if ([self hasVisibleLocationBar] && bridge) { |
| 288 decoration_ = bridge->GetPageInfoDecoration(); |
| 288 decoration_->SetActive(true); | 289 decoration_->SetActive(true); |
| 289 } | 290 } |
| 290 | 291 |
| 291 [super showWindow:sender]; | 292 [super showWindow:sender]; |
| 292 } | 293 } |
| 293 | 294 |
| 294 - (void)close { | 295 - (void)close { |
| 295 if (decoration_) { | 296 if (decoration_) { |
| 296 decoration_->SetActive(false); | 297 decoration_->SetActive(false); |
| 297 decoration_ = nullptr; | 298 decoration_ = nullptr; |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 } | 658 } |
| 658 | 659 |
| 659 - (IBAction)cancel:(id)sender { | 660 - (IBAction)cancel:(id)sender { |
| 660 // This is triggered by ESC when the bubble has focus. | 661 // This is triggered by ESC when the bubble has focus. |
| 661 if (delegate_) | 662 if (delegate_) |
| 662 delegate_->Closing(); | 663 delegate_->Closing(); |
| 663 [super cancel:sender]; | 664 [super cancel:sender]; |
| 664 } | 665 } |
| 665 | 666 |
| 666 @end // implementation PermissionBubbleController | 667 @end // implementation PermissionBubbleController |
| OLD | NEW |