summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/chrome_browser_window.h
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 22:37:55 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 22:37:55 +0000
commitd546029a268e19c244bcbfba57e4bd2d39d44a83 (patch)
tree82090113ed3095ac5db6fe5610a908846b7cf0ec /chrome/browser/cocoa/chrome_browser_window.h
parent8717745b839efbe446902f3449a3a348f687a42f (diff)
downloadchromium_src-d546029a268e19c244bcbfba57e4bd2d39d44a83.zip
chromium_src-d546029a268e19c244bcbfba57e4bd2d39d44a83.tar.gz
chromium_src-d546029a268e19c244bcbfba57e4bd2d39d44a83.tar.bz2
Several theming fixes for the Mac. Sorry for the extensive change, but they
were all sort of intertwined. Fixes up patterns in general so that they are all in phase. Moves the window widget buttons down by two pixels. Draws overlays correctly. Fixes up some accessibility issues with the default window widgets. Gets rid of some out of date files (tab_cell). BUG=18438, 18547, 19851, 20295, 22213, 23651, 24338 TEST=Launch Chrome. Switch to "dots" theme from the Google themes. Create a couple of tabs. Check to make sure that the background pattern line up with the tabs. Move the tabs around. Check that the hightlight colors and text colors look correct for all of the tabs. Make sure the patterns stay lined up. Resize the window, make sure none of the patterns move around. Create new windows by dragging the tabs out of the windows and make sure a new window is created with the correct pattern. Show the "find" bar. Make sure its pattern lines up correctly with the tabbar. Switch to default theme. Make sure it looks correct and draws properly. Switch to Zen theme and make sure that the overlay at the top draws correctly. Create a new window. make sure that the rollovers in the window widgets work correctly in both the active and inactive window. Mouse down on the zoom button in the inactive window and notice that the window context changes. Move off of the zoom button and mouse up. Mouse down on the miniaturize button on the inactive window and notice that the window context does not change. Move off of the miniaturize button and mouse up. Do the same thing you did for the miniaturize button for the close button. Start up Accessibility Inspector from the developer tools. Make sure that the window widgets report their accessibility information correctly. Review URL: http://codereview.chromium.org/260009 Patch from dmaclach@chromium.org. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/chrome_browser_window.h')
-rw-r--r--chrome/browser/cocoa/chrome_browser_window.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/chrome_browser_window.h b/chrome/browser/cocoa/chrome_browser_window.h
index 9130616..c25b489 100644
--- a/chrome/browser/cocoa/chrome_browser_window.h
+++ b/chrome/browser/cocoa/chrome_browser_window.h
@@ -7,12 +7,31 @@
#import <Cocoa/Cocoa.h>
+#include "base/scoped_nsobject.h"
+
+// Offset from the top of the window frame to the top of the window controls
+// (zoom, close, miniaturize).
+const NSInteger kChromeWindowButtonsOffsetFromTop = 7;
+
+// Offset from the left of the window frame to the top of the window controls
+// (zoom, close, miniaturize).
+const NSInteger kChromeWindowButtonsOffsetFromLeft = 8;
+
+// Offset between the window controls (zoom, close, miniaturize).
+const NSInteger kChromeWindowButtonsInterButtonSpacing = 7;
+
// Cocoa class representing a Chrome browser window.
// We need to override NSWindow with our own class since we need access to all
// unhandled keyboard events and subclassing NSWindow is the only method to do
-// this.
+// this. We also handle our own window controls and custom window frame drawing.
@interface ChromeBrowserWindow : NSWindow {
+ @private
BOOL shouldHideTitle_;
+ NSButton* closeButton_;
+ NSButton* miniaturizeButton_;
+ NSButton* zoomButton_;
+ BOOL entered_;
+ scoped_nsobject<NSTrackingArea> widgetTrackingArea_;
}
// See global_keyboard_shortcuts_mac.h for details on the next two functions.
@@ -31,6 +50,12 @@
// Tells the window to suppress title drawing.
- (void)setShouldHideTitle:(BOOL)flag;
+// Return true if the mouse is currently in our tracking area for our window
+// widgets.
+- (BOOL)mouseInGroup:(NSButton*)widget;
+
+// Update the tracking areas for our window widgets as appropriate.
+- (void)updateTrackingAreas;
@end
@interface ChromeBrowserWindow (UndocumentedAPI)