| 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" | |
| 10 #include "base/logging.h" | 9 #include "base/logging.h" |
| 11 #include "base/mac/sdk_forward_declarations.h" | 10 #include "base/mac/sdk_forward_declarations.h" |
| 12 #include "chrome/browser/global_keyboard_shortcuts_mac.h" | 11 #include "chrome/browser/global_keyboard_shortcuts_mac.h" |
| 13 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 12 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| 14 #include "chrome/browser/themes/theme_properties.h" | 13 #include "chrome/browser/themes/theme_properties.h" |
| 15 #include "chrome/browser/themes/theme_service.h" | 14 #include "chrome/browser/themes/theme_service.h" |
| 16 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 15 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 17 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 16 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
| 18 #include "chrome/browser/ui/cocoa/l10n_util.h" | 17 #include "chrome/browser/ui/cocoa/l10n_util.h" |
| 19 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 18 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 buttonFrame.origin.x += windowButtonsInterButtonSpacing_; | 154 buttonFrame.origin.x += windowButtonsInterButtonSpacing_; |
| 156 // fallthrough | 155 // fallthrough |
| 157 case NSWindowMiniaturizeButton: | 156 case NSWindowMiniaturizeButton: |
| 158 buttonFrame.origin.x += NSWidth([closeButton_ frame]); | 157 buttonFrame.origin.x += NSWidth([closeButton_ frame]); |
| 159 buttonFrame.origin.x += windowButtonsInterButtonSpacing_; | 158 buttonFrame.origin.x += windowButtonsInterButtonSpacing_; |
| 160 // fallthrough | 159 // fallthrough |
| 161 default: | 160 default: |
| 162 break; | 161 break; |
| 163 } | 162 } |
| 164 | 163 |
| 165 if (cocoa_l10n_util::ExperimentalMacRTLIsEnabled() && base::i18n::IsRTL()) { | 164 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { |
| 166 buttonFrame.origin.x = | 165 buttonFrame.origin.x = |
| 167 NSWidth([self frame]) - buttonFrame.origin.x - NSWidth([button frame]); | 166 NSWidth([self frame]) - buttonFrame.origin.x - NSWidth([button frame]); |
| 168 } | 167 } |
| 169 | 168 |
| 170 BOOL didPost = [button postsBoundsChangedNotifications]; | 169 BOOL didPost = [button postsBoundsChangedNotifications]; |
| 171 [button setPostsFrameChangedNotifications:NO]; | 170 [button setPostsFrameChangedNotifications:NO]; |
| 172 [button setFrame:buttonFrame]; | 171 [button setFrame:buttonFrame]; |
| 173 [button setPostsFrameChangedNotifications:didPost]; | 172 [button setPostsFrameChangedNotifications:didPost]; |
| 174 } | 173 } |
| 175 | 174 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 [self childWindowsDidChange]; | 362 [self childWindowsDidChange]; |
| 364 } | 363 } |
| 365 | 364 |
| 366 - (void)childWindowsDidChange { | 365 - (void)childWindowsDidChange { |
| 367 id delegate = [self delegate]; | 366 id delegate = [self delegate]; |
| 368 if ([delegate respondsToSelector:@selector(childWindowsDidChange)]) | 367 if ([delegate respondsToSelector:@selector(childWindowsDidChange)]) |
| 369 [delegate childWindowsDidChange]; | 368 [delegate childWindowsDidChange]; |
| 370 } | 369 } |
| 371 | 370 |
| 372 @end | 371 @end |
| OLD | NEW |