OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_UI_COCOA_FRAMED_BROWSER_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_FRAMED_BROWSER_WINDOW_H_ |
6 #define CHROME_BROWSER_UI_COCOA_FRAMED_BROWSER_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_COCOA_FRAMED_BROWSER_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
11 #include "base/scoped_nsobject.h" | 11 #include "base/scoped_nsobject.h" |
12 #include "chrome/browser/ui/cocoa/chrome_browser_window.h" | 12 #include "chrome/browser/ui/cocoa/chrome_browser_window.h" |
13 | 13 |
14 // Offsets from the top/left of the window frame to the top of the window | 14 // Offset from the top of the window frame to the top of the window controls |
15 // controls (zoom, close, miniaturize) for a window with a tabstrip. | 15 // (zoom, close, miniaturize) for a window with a tabstrip. |
16 const NSInteger kFramedWindowButtonsWithTabStripOffsetFromTop = 10; | 16 const NSInteger kFramedWindowButtonsWithTabStripOffsetFromTop = 6; |
17 const NSInteger kFramedWindowButtonsWithTabStripOffsetFromLeft = 10; | |
18 | 17 |
19 // Offsets from the top/left of the window frame to the top of the window | 18 // Offset from the top of the window frame to the top of the window controls |
20 // controls (zoom, close, miniaturize) for a window without a tabstrip. | 19 // (zoom, close, miniaturize) for a window without a tabstrip. |
21 const NSInteger kFramedWindowButtonsWithoutTabStripOffsetFromTop = 4; | 20 const NSInteger kFramedWindowButtonsWithoutTabStripOffsetFromTop = 4; |
22 const NSInteger kFramedWindowButtonsWithoutTabStripOffsetFromLeft = 8; | 21 |
| 22 // Offset from the left of the window frame to the top of the window controls |
| 23 // (zoom, close, miniaturize). |
| 24 const NSInteger kFramedWindowButtonsOffsetFromLeft = 8; |
23 | 25 |
24 // Offset between the window controls (zoom, close, miniaturize). | 26 // Offset between the window controls (zoom, close, miniaturize). |
25 const NSInteger kFramedWindowButtonsInterButtonSpacing = 7; | 27 const NSInteger kFramedWindowButtonsInterButtonSpacing = 7; |
26 | 28 |
27 // Cocoa class representing a framed browser window. | 29 // Cocoa class representing a framed browser window. |
28 // We need to override NSWindow with our own class since we need access to all | 30 // We need to override NSWindow with our own class since we need access to all |
29 // unhandled keyboard events and subclassing NSWindow is the only method to do | 31 // unhandled keyboard events and subclassing NSWindow is the only method to do |
30 // this. We also handle our own window controls and custom window frame drawing. | 32 // this. We also handle our own window controls and custom window frame drawing. |
31 @interface FramedBrowserWindow : ChromeBrowserWindow { | 33 @interface FramedBrowserWindow : ChromeBrowserWindow { |
32 @private | 34 @private |
(...skipping 21 matching lines...) Expand all Loading... |
54 | 56 |
55 // Undocumented Cocoa API to suppress drawing of the window's title. | 57 // Undocumented Cocoa API to suppress drawing of the window's title. |
56 // -setTitle: still works, but the title set only applies to the | 58 // -setTitle: still works, but the title set only applies to the |
57 // miniwindow and menus (and, importantly, Expose). Overridden to | 59 // miniwindow and menus (and, importantly, Expose). Overridden to |
58 // return |shouldHideTitle_|. | 60 // return |shouldHideTitle_|. |
59 -(BOOL)_isTitleHidden; | 61 -(BOOL)_isTitleHidden; |
60 | 62 |
61 @end | 63 @end |
62 | 64 |
63 #endif // CHROME_BROWSER_UI_COCOA_FRAMED_BROWSER_WINDOW_H_ | 65 #endif // CHROME_BROWSER_UI_COCOA_FRAMED_BROWSER_WINDOW_H_ |
OLD | NEW |