OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include <Carbon/Carbon.h> | 5 #include <Carbon/Carbon.h> |
6 | 6 |
7 #include "base/mac_util.h" | 7 #include "base/mac_util.h" |
8 #include "base/scoped_nsdisable_screen_updates.h" | 8 #include "base/scoped_nsdisable_screen_updates.h" |
9 #import "base/scoped_nsobject.h" | 9 #import "base/scoped_nsobject.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 willPositionSheet:(NSWindow*)sheet | 1141 willPositionSheet:(NSWindow*)sheet |
1142 usingRect:(NSRect)defaultSheetRect { | 1142 usingRect:(NSRect)defaultSheetRect { |
1143 // Any sheet should come from right above the visible content area. | 1143 // Any sheet should come from right above the visible content area. |
1144 NSRect toolbarFrame = [[toolbarController_ view] frame]; | 1144 NSRect toolbarFrame = [[toolbarController_ view] frame]; |
1145 NSRect infobarFrame = [[infoBarContainerController_ view] frame]; | 1145 NSRect infobarFrame = [[infoBarContainerController_ view] frame]; |
1146 defaultSheetRect.origin.y = toolbarFrame.origin.y - infobarFrame.size.height; | 1146 defaultSheetRect.origin.y = toolbarFrame.origin.y - infobarFrame.size.height; |
1147 | 1147 |
1148 return defaultSheetRect; | 1148 return defaultSheetRect; |
1149 } | 1149 } |
1150 | 1150 |
1151 // In addition to the tab strip and content area, which the superview's impl | |
1152 // takes care of, we need to add the toolbar and bookmark bar to the | |
1153 // overlay so they draw correctly when dragging out a new window. | |
1154 - (NSArray*)viewsToMoveToOverlay { | |
1155 NSArray* views = [super viewsToMoveToOverlay]; | |
1156 NSArray* browserViews = | |
1157 [NSArray arrayWithObjects:[toolbarController_ view], | |
1158 nil]; | |
1159 return [views arrayByAddingObjectsFromArray:browserViews]; | |
1160 } | |
1161 | |
1162 // Undocumented method for multi-touch gestures in 10.5. Future OS's will | 1151 // Undocumented method for multi-touch gestures in 10.5. Future OS's will |
1163 // likely add a public API, but the worst that will happen is that this will | 1152 // likely add a public API, but the worst that will happen is that this will |
1164 // turn into dead code and just won't get called. | 1153 // turn into dead code and just won't get called. |
1165 - (void)swipeWithEvent:(NSEvent*)event { | 1154 - (void)swipeWithEvent:(NSEvent*)event { |
1166 // Map forwards and backwards to history; left is positive, right is negative. | 1155 // Map forwards and backwards to history; left is positive, right is negative. |
1167 unsigned int command = 0; | 1156 unsigned int command = 0; |
1168 if ([event deltaX] > 0.5) | 1157 if ([event deltaX] > 0.5) |
1169 command = IDC_BACK; | 1158 command = IDC_BACK; |
1170 else if ([event deltaX] < -0.5) | 1159 else if ([event deltaX] < -0.5) |
1171 command = IDC_FORWARD; | 1160 command = IDC_FORWARD; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 provider->GetNSColor(BrowserThemeProvider::COLOR_TOOLBAR); | 1398 provider->GetNSColor(BrowserThemeProvider::COLOR_TOOLBAR); |
1410 [theme setValue:toolbarBackgroundColor | 1399 [theme setValue:toolbarBackgroundColor |
1411 forAttribute:@"backgroundColor" | 1400 forAttribute:@"backgroundColor" |
1412 style:GTMThemeStyleToolBar | 1401 style:GTMThemeStyleToolBar |
1413 state:GTMThemeStateActiveWindow]; | 1402 state:GTMThemeStateActiveWindow]; |
1414 | 1403 |
1415 return theme; | 1404 return theme; |
1416 } | 1405 } |
1417 @end | 1406 @end |
1418 | 1407 |
OLD | NEW |