diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 17:21:11 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 17:21:11 +0000 |
commit | f59cdf7bf45ed21cf70c8d2bc43ef4cc70cc94c0 (patch) | |
tree | 400d7f06be1466d0ba4b6b71272b412ae41a292a /chrome/browser | |
parent | ee8f30e6d53fc657305af0bd074066f5bca1b63c (diff) | |
download | chromium_src-f59cdf7bf45ed21cf70c8d2bc43ef4cc70cc94c0.zip chromium_src-f59cdf7bf45ed21cf70c8d2bc43ef4cc70cc94c0.tar.gz chromium_src-f59cdf7bf45ed21cf70c8d2bc43ef4cc70cc94c0.tar.bz2 |
[Mac] Rename ChromeBrowserWindow to FramedBrowserWindow.
BUG=53449
TEST=No visible impact. Everything should still work.
Review URL: http://codereview.chromium.org/3189026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/cocoa/browser_frame_view.mm | 16 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_cocoa.mm | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.h | 1 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller_private.mm | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/framed_browser_window.h (renamed from chrome/browser/cocoa/chrome_browser_window.h) | 20 | ||||
-rw-r--r-- | chrome/browser/cocoa/framed_browser_window.mm (renamed from chrome/browser/cocoa/chrome_browser_window.mm) | 18 | ||||
-rw-r--r-- | chrome/browser/cocoa/framed_browser_window_unittest.mm (renamed from chrome/browser/cocoa/chrome_browser_window_unittest.mm) | 32 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view_mac.mm | 1 |
8 files changed, 45 insertions, 47 deletions
diff --git a/chrome/browser/cocoa/browser_frame_view.mm b/chrome/browser/cocoa/browser_frame_view.mm index 1c07ab8..7914435 100644 --- a/chrome/browser/cocoa/browser_frame_view.mm +++ b/chrome/browser/cocoa/browser_frame_view.mm @@ -9,7 +9,7 @@ #include "base/logging.h" #include "base/scoped_nsautorelease_pool.h" -#import "chrome/browser/cocoa/chrome_browser_window.h" +#import "chrome/browser/cocoa/framed_browser_window.h" #import "chrome/browser/cocoa/themed_window.h" #import "chrome/browser/themes/browser_theme_provider.h" #include "grit/theme_resources.h" @@ -116,7 +116,7 @@ static BOOL gCanGetCornerRadius = NO; - (void)drawRect:(NSRect)rect { // If this isn't the window class we expect, then pass it on to the // original implementation. - if (![[self window] isKindOfClass:[ChromeBrowserWindow class]]) { + if (![[self window] isKindOfClass:[FramedBrowserWindow class]]) { [self drawRectOriginal:rect]; return; } @@ -327,9 +327,9 @@ static BOOL gCanGetCornerRadius = NO; // Check to see if the mouse is currently in one of our window widgets. - (BOOL)_mouseInGroup:(NSButton*)widget { BOOL mouseInGroup = NO; - if ([[self window] isKindOfClass:[ChromeBrowserWindow class]]) { - ChromeBrowserWindow* window = - static_cast<ChromeBrowserWindow*>([self window]); + if ([[self window] isKindOfClass:[FramedBrowserWindow class]]) { + FramedBrowserWindow* window = + static_cast<FramedBrowserWindow*>([self window]); mouseInGroup = [window mouseInGroup:widget]; } else if ([super respondsToSelector:@selector(_mouseInGroup:)]) { mouseInGroup = [super _mouseInGroup:widget]; @@ -340,9 +340,9 @@ static BOOL gCanGetCornerRadius = NO; // Let our window handle updating the window widget tracking area. - (void)updateTrackingAreas { [super updateTrackingAreas]; - if ([[self window] isKindOfClass:[ChromeBrowserWindow class]]) { - ChromeBrowserWindow* window = - static_cast<ChromeBrowserWindow*>([self window]); + if ([[self window] isKindOfClass:[FramedBrowserWindow class]]) { + FramedBrowserWindow* window = + static_cast<FramedBrowserWindow*>([self window]); [window updateTrackingAreas]; } } diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm index 0e6e7db..a89421f 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/cocoa/browser_window_cocoa.mm @@ -15,7 +15,7 @@ #include "chrome/browser/browser_list.h" #import "chrome/browser/cocoa/browser_window_controller.h" #import "chrome/browser/cocoa/bug_report_window_controller.h" -#import "chrome/browser/cocoa/chrome_browser_window.h" +#import "chrome/browser/cocoa/chrome_event_processing_window.h" #import "chrome/browser/cocoa/clear_browsing_data_controller.h" #import "chrome/browser/cocoa/collected_cookies_mac.h" #import "chrome/browser/cocoa/content_settings_dialog_controller.h" diff --git a/chrome/browser/cocoa/browser_window_controller.h b/chrome/browser/cocoa/browser_window_controller.h index 274e23b..d4fe820 100644 --- a/chrome/browser/cocoa/browser_window_controller.h +++ b/chrome/browser/cocoa/browser_window_controller.h @@ -28,7 +28,6 @@ class Browser; class BrowserWindow; class BrowserWindowCocoa; -@class ChromeBrowserWindow; class ConstrainedWindowMac; @class DownloadShelfController; @class FindBarCocoaController; diff --git a/chrome/browser/cocoa/browser_window_controller_private.mm b/chrome/browser/cocoa/browser_window_controller_private.mm index fe0bc2a..35ea1e0 100644 --- a/chrome/browser/cocoa/browser_window_controller_private.mm +++ b/chrome/browser/cocoa/browser_window_controller_private.mm @@ -9,10 +9,10 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" -#import "chrome/browser/cocoa/chrome_browser_window.h" #import "chrome/browser/cocoa/fast_resize_view.h" #import "chrome/browser/cocoa/find_bar_cocoa_controller.h" #import "chrome/browser/cocoa/floating_bar_backing_view.h" +#import "chrome/browser/cocoa/framed_browser_window.h" #import "chrome/browser/cocoa/fullscreen_controller.h" #import "chrome/browser/cocoa/side_tab_strip_controller.h" #import "chrome/browser/cocoa/tab_strip_controller.h" diff --git a/chrome/browser/cocoa/chrome_browser_window.h b/chrome/browser/cocoa/framed_browser_window.h index 810c87fb..adaf1e0 100644 --- a/chrome/browser/cocoa/chrome_browser_window.h +++ b/chrome/browser/cocoa/framed_browser_window.h @@ -1,9 +1,9 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_COCOA_CHROME_BROWSER_WINDOW_H_ -#define CHROME_BROWSER_COCOA_CHROME_BROWSER_WINDOW_H_ +#ifndef CHROME_BROWSER_COCOA_FRAMED_BROWSER_WINDOW_H_ +#define CHROME_BROWSER_COCOA_FRAMED_BROWSER_WINDOW_H_ #pragma once #import <Cocoa/Cocoa.h> @@ -13,24 +13,24 @@ // Offset from the top of the window frame to the top of the window controls // (zoom, close, miniaturize) for a window with a tabstrip. -const NSInteger kChromeWindowButtonsWithTabStripOffsetFromTop = 6; +const NSInteger kFramedWindowButtonsWithTabStripOffsetFromTop = 6; // Offset from the top of the window frame to the top of the window controls // (zoom, close, miniaturize) for a window without a tabstrip. -const NSInteger kChromeWindowButtonsWithoutTabStripOffsetFromTop = 4; +const NSInteger kFramedWindowButtonsWithoutTabStripOffsetFromTop = 4; // Offset from the left of the window frame to the top of the window controls // (zoom, close, miniaturize). -const NSInteger kChromeWindowButtonsOffsetFromLeft = 8; +const NSInteger kFramedWindowButtonsOffsetFromLeft = 8; // Offset between the window controls (zoom, close, miniaturize). -const NSInteger kChromeWindowButtonsInterButtonSpacing = 7; +const NSInteger kFramedWindowButtonsInterButtonSpacing = 7; -// Cocoa class representing a Chrome browser window. +// Cocoa class representing a framed 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. We also handle our own window controls and custom window frame drawing. -@interface ChromeBrowserWindow : ChromeEventProcessingWindow { +@interface FramedBrowserWindow : ChromeEventProcessingWindow { @private BOOL shouldHideTitle_; NSButton* closeButton_; @@ -68,4 +68,4 @@ const NSInteger kChromeWindowButtonsInterButtonSpacing = 7; @end -#endif // CHROME_BROWSER_COCOA_CHROME_BROWSER_WINDOW_H_ +#endif // CHROME_BROWSER_COCOA_FRAMED_BROWSER_WINDOW_H_ diff --git a/chrome/browser/cocoa/chrome_browser_window.mm b/chrome/browser/cocoa/framed_browser_window.mm index 9e0df76..ef246b6 100644 --- a/chrome/browser/cocoa/chrome_browser_window.mm +++ b/chrome/browser/cocoa/framed_browser_window.mm @@ -1,8 +1,8 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "chrome/browser/cocoa/chrome_browser_window.h" +#import "chrome/browser/cocoa/framed_browser_window.h" #include "base/logging.h" #import "chrome/browser/cocoa/browser_frame_view.h" @@ -27,12 +27,12 @@ namespace { // buttons (so that they highlight and activate correctly) as well as implement // the private method _mouseInGroup in our frame view class which is required // to get the rollover highlight drawing to draw correctly. -@interface ChromeBrowserWindow(ChromeBrowserWindowPrivateMethods) +@interface FramedBrowserWindow(PrivateMethods) // Return the view that does the "frame" drawing. - (NSView*)frameView; @end -@implementation ChromeBrowserWindow +@implementation FramedBrowserWindow - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle @@ -119,10 +119,10 @@ namespace { forStyleMask:aStyle]; NSRect closeButtonFrame = [closeButton_ frame]; CGFloat yOffset = [browserController hasTabStrip] ? - kChromeWindowButtonsWithTabStripOffsetFromTop : - kChromeWindowButtonsWithoutTabStripOffsetFromTop; + kFramedWindowButtonsWithTabStripOffsetFromTop : + kFramedWindowButtonsWithoutTabStripOffsetFromTop; closeButtonFrame.origin = - NSMakePoint(kChromeWindowButtonsOffsetFromLeft, + NSMakePoint(kFramedWindowButtonsOffsetFromLeft, (NSHeight(frameViewBounds) - NSHeight(closeButtonFrame) - yOffset)); @@ -137,7 +137,7 @@ namespace { NSRect miniaturizeButtonFrame = [miniaturizeButton_ frame]; miniaturizeButtonFrame.origin = NSMakePoint((NSMaxX(closeButtonFrame) + - kChromeWindowButtonsInterButtonSpacing), + kFramedWindowButtonsInterButtonSpacing), NSMinY(closeButtonFrame)); [miniaturizeButton_ setFrame:miniaturizeButtonFrame]; [miniaturizeButton_ setTarget:self]; @@ -150,7 +150,7 @@ namespace { NSRect zoomButtonFrame = [zoomButton_ frame]; zoomButtonFrame.origin = NSMakePoint((NSMaxX(miniaturizeButtonFrame) + - kChromeWindowButtonsInterButtonSpacing), + kFramedWindowButtonsInterButtonSpacing), NSMinY(miniaturizeButtonFrame)); [zoomButton_ setFrame:zoomButtonFrame]; [zoomButton_ setTarget:self]; diff --git a/chrome/browser/cocoa/chrome_browser_window_unittest.mm b/chrome/browser/cocoa/framed_browser_window_unittest.mm index f9cd4dc..038e7c9 100644 --- a/chrome/browser/cocoa/chrome_browser_window_unittest.mm +++ b/chrome/browser/cocoa/framed_browser_window_unittest.mm @@ -6,23 +6,23 @@ #include "base/scoped_nsobject.h" #include "chrome/app/chrome_dll_resource.h" -#import "chrome/browser/cocoa/chrome_browser_window.h" #import "chrome/browser/cocoa/browser_window_controller.h" #import "chrome/browser/cocoa/browser_frame_view.h" #import "chrome/browser/cocoa/cocoa_test_helper.h" +#import "chrome/browser/cocoa/framed_browser_window.h" #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #include "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" -class ChromeBrowserWindowTest : public CocoaTest { +class FramedBrowserWindowTest : public CocoaTest { public: virtual void SetUp() { CocoaTest::SetUp(); // Create a window. const NSUInteger mask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask; - window_ = [[ChromeBrowserWindow alloc] + window_ = [[FramedBrowserWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) styleMask:mask backing:NSBackingStoreBuffered @@ -52,17 +52,17 @@ class ChromeBrowserWindowTest : public CocoaTest { return [image TIFFRepresentation]; } - ChromeBrowserWindow* window_; + FramedBrowserWindow* window_; }; // Baseline test that the window creates, displays, closes, and // releases. -TEST_F(ChromeBrowserWindowTest, ShowAndClose) { +TEST_F(FramedBrowserWindowTest, ShowAndClose) { [window_ display]; } // Test that undocumented title-hiding API we're using does the job. -TEST_F(ChromeBrowserWindowTest, DoesHideTitle) { +TEST_F(FramedBrowserWindowTest, DoesHideTitle) { // The -display calls are not strictly necessary, but they do // make it easier to see what's happening when debugging (without // them the changes are never flushed to the screen). @@ -93,7 +93,7 @@ TEST_F(ChromeBrowserWindowTest, DoesHideTitle) { } // Test to make sure that our window widgets are in the right place. -TEST_F(ChromeBrowserWindowTest, WindowWidgetLocation) { +TEST_F(FramedBrowserWindowTest, WindowWidgetLocation) { // First without tabstrip. NSCell* closeBoxCell = [window_ accessibilityAttributeValue: NSAccessibilityCloseButtonAttribute]; @@ -104,8 +104,8 @@ TEST_F(ChromeBrowserWindowTest, WindowWidgetLocation) { windowBounds.origin = NSZeroPoint; EXPECT_EQ(NSMaxY(closeBoxFrame), NSMaxY(windowBounds) - - kChromeWindowButtonsWithoutTabStripOffsetFromTop); - EXPECT_EQ(NSMinX(closeBoxFrame), kChromeWindowButtonsOffsetFromLeft); + kFramedWindowButtonsWithoutTabStripOffsetFromTop); + EXPECT_EQ(NSMinX(closeBoxFrame), kFramedWindowButtonsOffsetFromLeft); NSCell* miniaturizeCell = [window_ accessibilityAttributeValue: NSAccessibilityMinimizeButtonAttribute]; @@ -114,9 +114,9 @@ TEST_F(ChromeBrowserWindowTest, WindowWidgetLocation) { NSRect miniaturizeFrame = [miniaturizeControl frame]; EXPECT_EQ(NSMaxY(miniaturizeFrame), NSMaxY(windowBounds) - - kChromeWindowButtonsWithoutTabStripOffsetFromTop); + kFramedWindowButtonsWithoutTabStripOffsetFromTop); EXPECT_EQ(NSMinX(miniaturizeFrame), - NSMaxX(closeBoxFrame) + kChromeWindowButtonsInterButtonSpacing); + NSMaxX(closeBoxFrame) + kFramedWindowButtonsInterButtonSpacing); // Then with a tabstrip. id controller = [OCMockObject mockForClass:[BrowserWindowController class]]; @@ -138,8 +138,8 @@ TEST_F(ChromeBrowserWindowTest, WindowWidgetLocation) { windowBounds.origin = NSZeroPoint; EXPECT_EQ(NSMaxY(closeBoxFrame), NSMaxY(windowBounds) - - kChromeWindowButtonsWithTabStripOffsetFromTop); - EXPECT_EQ(NSMinX(closeBoxFrame), kChromeWindowButtonsOffsetFromLeft); + kFramedWindowButtonsWithTabStripOffsetFromTop); + EXPECT_EQ(NSMinX(closeBoxFrame), kFramedWindowButtonsOffsetFromLeft); miniaturizeCell = [window_ accessibilityAttributeValue: NSAccessibilityMinimizeButtonAttribute]; @@ -148,14 +148,14 @@ TEST_F(ChromeBrowserWindowTest, WindowWidgetLocation) { miniaturizeFrame = [miniaturizeControl frame]; EXPECT_EQ(NSMaxY(miniaturizeFrame), NSMaxY(windowBounds) - - kChromeWindowButtonsWithTabStripOffsetFromTop); + kFramedWindowButtonsWithTabStripOffsetFromTop); EXPECT_EQ(NSMinX(miniaturizeFrame), - NSMaxX(closeBoxFrame) + kChromeWindowButtonsInterButtonSpacing); + NSMaxX(closeBoxFrame) + kFramedWindowButtonsInterButtonSpacing); [window_ setWindowController:nil]; } // Test that we actually have a tracking area in place. -TEST_F(ChromeBrowserWindowTest, WindowWidgetTrackingArea) { +TEST_F(FramedBrowserWindowTest, WindowWidgetTrackingArea) { NSCell* closeBoxCell = [window_ accessibilityAttributeValue:NSAccessibilityCloseButtonAttribute]; NSView* closeBoxControl = [closeBoxCell controlView]; diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index 7a08058..6d3b158 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -10,7 +10,6 @@ #import "base/chrome_application_mac.h" #import "chrome/browser/cocoa/focus_tracker.h" -#import "chrome/browser/cocoa/chrome_browser_window.h" #import "chrome/browser/cocoa/browser_window_controller.h" #include "chrome/browser/global_keyboard_shortcuts_mac.h" #include "chrome/browser/cocoa/sad_tab_controller.h" |