Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tabs/tab_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 iconView_.reset([[SpriteView alloc] initWithFrame:originalIconFrame_]); | 100 iconView_.reset([[SpriteView alloc] initWithFrame:originalIconFrame_]); |
| 101 [iconView_ setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin]; | 101 [iconView_ setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin]; |
| 102 | 102 |
| 103 // When the icon is removed, the title expands to the left to fill the | 103 // When the icon is removed, the title expands to the left to fill the |
| 104 // space left by the icon. When the close button is removed, the title | 104 // space left by the icon. When the close button is removed, the title |
| 105 // expands to the right to fill its space. These are the amounts to expand | 105 // expands to the right to fill its space. These are the amounts to expand |
| 106 // and contract the title frame under those conditions. We don't have to | 106 // and contract the title frame under those conditions. We don't have to |
| 107 // explicilty save the offset between the title and the close button since | 107 // explicilty save the offset between the title and the close button since |
| 108 // we can just get that value for the close button's frame. | 108 // we can just get that value for the close button's frame. |
| 109 NSRect titleFrame = NSMakeRect(35, 6, 92, 17); | 109 NSRect titleFrame = NSMakeRect(35, 6, 92, 17); |
| 110 if (!isModeMaterial) { | |
| 111 titleFrame.size.height = 14; | |
|
shrike
2016/09/16 18:51:09
Pre-MD this code read
NSRect titleFrame = NSM
| |
| 112 } | |
| 113 | 110 |
| 114 // Close button. | 111 // Close button. |
| 115 NSRect closeButtonFrame = NSMakeRect(129, 6, 16, 16); | 112 NSRect closeButtonFrame = NSMakeRect(129, 6, 16, 16); |
| 116 if (!isModeMaterial) { | 113 if (!isModeMaterial) { |
| 117 closeButtonFrame = NSMakeRect(127, 4, 18, 18); | 114 closeButtonFrame = NSMakeRect(127, 4, 18, 18); |
| 118 } | 115 } |
| 119 closeButton_.reset([[HoverCloseButton alloc] initWithFrame: | 116 closeButton_.reset([[HoverCloseButton alloc] initWithFrame: |
| 120 closeButtonFrame]); | 117 closeButtonFrame]); |
| 121 [closeButton_ setAutoresizingMask:NSViewMinXMargin]; | 118 [closeButton_ setAutoresizingMask:NSViewMinXMargin]; |
| 122 [closeButton_ setTarget:self]; | 119 [closeButton_ setTarget:self]; |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 463 YES : NO; | 460 YES : NO; |
| 464 } | 461 } |
| 465 return NO; | 462 return NO; |
| 466 } | 463 } |
| 467 | 464 |
| 468 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab { | 465 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab { |
| 469 [[target_ dragController] maybeStartDrag:event forTab:tab]; | 466 [[target_ dragController] maybeStartDrag:event forTab:tab]; |
| 470 } | 467 } |
| 471 | 468 |
| 472 @end | 469 @end |
| OLD | NEW |