| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/panels/panel_titlebar_view_cocoa.h" | 5 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> // kVK_Escape | 7 #include <Carbon/Carbon.h> // kVK_Escape |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 selector:@selector(restartGlintAnimation:) | 538 selector:@selector(restartGlintAnimation:) |
| 539 userInfo:nil | 539 userInfo:nil |
| 540 repeats:NO] retain]); | 540 repeats:NO] retain]); |
| 541 // Gradually reduce the frequency of repeating the animation, | 541 // Gradually reduce the frequency of repeating the animation, |
| 542 // calming it down if user decides not to act upon it. | 542 // calming it down if user decides not to act upon it. |
| 543 if (glintInterval_ < kFinalGlintRepeatIntervalSeconds) | 543 if (glintInterval_ < kFinalGlintRepeatIntervalSeconds) |
| 544 glintInterval_ *= kGlintRepeatIntervalIncreaseFactor; | 544 glintInterval_ *= kGlintRepeatIntervalIncreaseFactor; |
| 545 } | 545 } |
| 546 } | 546 } |
| 547 | 547 |
| 548 - (int)iconOnlyWidthInScreenCoordinates { |
| 549 int width = kIconAndTextPadding * 2; |
| 550 if (!icon_) |
| 551 return width; |
| 552 |
| 553 return width + NSWidth([self convertRect:[icon_ frame] toView:nil]); |
| 554 } |
| 555 |
| 548 // (Private/TestingAPI) | 556 // (Private/TestingAPI) |
| 549 - (PanelWindowControllerCocoa*)controller { | 557 - (PanelWindowControllerCocoa*)controller { |
| 550 return controller_; | 558 return controller_; |
| 551 } | 559 } |
| 552 | 560 |
| 553 - (NSTextField*)title { | 561 - (NSTextField*)title { |
| 554 return title_; | 562 return title_; |
| 555 } | 563 } |
| 556 | 564 |
| 557 - (void)simulateCloseButtonClick { | 565 - (void)simulateCloseButtonClick { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 } | 601 } |
| 594 | 602 |
| 595 - (void)checkMouseAndUpdateSettingsButtonVisibility { | 603 - (void)checkMouseAndUpdateSettingsButtonVisibility { |
| 596 BOOL mouseOverWindow = NSPointInRect([NSEvent mouseLocation], | 604 BOOL mouseOverWindow = NSPointInRect([NSEvent mouseLocation], |
| 597 [[self window] frame]); | 605 [[self window] frame]); |
| 598 [self updateSettingsButtonVisibility:mouseOverWindow]; | 606 [self updateSettingsButtonVisibility:mouseOverWindow]; |
| 599 } | 607 } |
| 600 | 608 |
| 601 @end | 609 @end |
| 602 | 610 |
| OLD | NEW |