| 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/framed_browser_window.h" | 5 #import "chrome/browser/ui/cocoa/framed_browser_window.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "base/mac/sdk_forward_declarations.h" | 11 #include "base/mac/sdk_forward_declarations.h" |
| 11 #include "chrome/browser/global_keyboard_shortcuts_mac.h" | 12 #include "chrome/browser/global_keyboard_shortcuts_mac.h" |
| 12 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 13 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| 13 #include "chrome/browser/themes/theme_properties.h" | 14 #include "chrome/browser/themes/theme_properties.h" |
| 14 #include "chrome/browser/themes/theme_service.h" | 15 #include "chrome/browser/themes/theme_service.h" |
| 15 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 16 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 16 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 17 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
| 17 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 18 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 18 #import "chrome/browser/ui/cocoa/themed_window.h" | 19 #import "chrome/browser/ui/cocoa/themed_window.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 buttonFrame.origin.x += windowButtonsInterButtonSpacing_; | 154 buttonFrame.origin.x += windowButtonsInterButtonSpacing_; |
| 154 // fallthrough | 155 // fallthrough |
| 155 case NSWindowMiniaturizeButton: | 156 case NSWindowMiniaturizeButton: |
| 156 buttonFrame.origin.x += NSWidth([closeButton_ frame]); | 157 buttonFrame.origin.x += NSWidth([closeButton_ frame]); |
| 157 buttonFrame.origin.x += windowButtonsInterButtonSpacing_; | 158 buttonFrame.origin.x += windowButtonsInterButtonSpacing_; |
| 158 // fallthrough | 159 // fallthrough |
| 159 default: | 160 default: |
| 160 break; | 161 break; |
| 161 } | 162 } |
| 162 | 163 |
| 164 if (base::i18n::IsRTL()) { |
| 165 buttonFrame.origin.x = NSWidth([self frame]) - buttonFrame.origin.x - |
| 166 NSWidth([button frame]); |
| 167 } |
| 168 |
| 163 BOOL didPost = [button postsBoundsChangedNotifications]; | 169 BOOL didPost = [button postsBoundsChangedNotifications]; |
| 164 [button setPostsFrameChangedNotifications:NO]; | 170 [button setPostsFrameChangedNotifications:NO]; |
| 165 [button setFrame:buttonFrame]; | 171 [button setFrame:buttonFrame]; |
| 166 [button setPostsFrameChangedNotifications:didPost]; | 172 [button setPostsFrameChangedNotifications:didPost]; |
| 167 } | 173 } |
| 168 | 174 |
| 169 // The tab strip view covers our window buttons. So we add hit testing here | 175 // The tab strip view covers our window buttons. So we add hit testing here |
| 170 // to find them properly and return them to the accessibility system. | 176 // to find them properly and return them to the accessibility system. |
| 171 - (id)accessibilityHitTest:(NSPoint)point { | 177 - (id)accessibilityHitTest:(NSPoint)point { |
| 172 NSPoint windowPoint = ui::ConvertPointFromScreenToWindow(self, point); | 178 NSPoint windowPoint = ui::ConvertPointFromScreenToWindow(self, point); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 [self childWindowsDidChange]; | 362 [self childWindowsDidChange]; |
| 357 } | 363 } |
| 358 | 364 |
| 359 - (void)childWindowsDidChange { | 365 - (void)childWindowsDidChange { |
| 360 id delegate = [self delegate]; | 366 id delegate = [self delegate]; |
| 361 if ([delegate respondsToSelector:@selector(childWindowsDidChange)]) | 367 if ([delegate respondsToSelector:@selector(childWindowsDidChange)]) |
| 362 [delegate childWindowsDidChange]; | 368 [delegate childWindowsDidChange]; |
| 363 } | 369 } |
| 364 | 370 |
| 365 @end | 371 @end |
| OLD | NEW |