Commit a7746302 authored by koz@chromium.org's avatar koz@chromium.org

Make the shadow for the fullscreen exit bubble for mac more prominent.

xib changes: Add padding to the sides of the view to accommodate rendering a thick shadow around the edges of the fullscreen exit bubble.

BUG=100879

Review URL: http://codereview.chromium.org/8425007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109991 0039d316-1c4b-4281-b951-d872f2087c98
parent 488b4204
This diff is collapsed.
......@@ -13,7 +13,6 @@ class TabContentsWrapper;
@class BrowserWindowController;
class Browser;
@class GTMUILocalizerAndLayoutTweaker;
@class InfoBubbleView;
// The FullscreenExitBubbleController manages the bubble that tells the user
// how to escape fullscreen mode. The bubble only appears when a tab requests
......@@ -32,7 +31,6 @@ class Browser;
IBOutlet NSTextField* messageLabel_;
IBOutlet NSButton* allowButton_;
IBOutlet NSButton* denyButton_;
IBOutlet InfoBubbleView* bubble_;
IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_;
// Text fields don't work as well with embedded links as text views, but
......
......@@ -27,7 +27,6 @@
namespace {
const int kBubbleOffsetY = 10;
const float kInitialDelay = 3.8;
const float kHideDuration = 0.7;
} // namespace
......@@ -110,7 +109,6 @@ const float kHideDuration = 0.7;
- (void)showWindow {
// Completes nib load.
InfoBubbleWindow* info_bubble = static_cast<InfoBubbleWindow*>([self window]);
[bubble_ setArrowLocation:info_bubble::kNoArrow];
[info_bubble setCanBecomeKeyWindow:NO];
if (!fullscreen_bubble::ShowButtonsForType(bubbleType_)) {
[self showButtons:NO];
......@@ -137,7 +135,6 @@ const float kHideDuration = 0.7;
NSPoint origin;
origin.x = (int)(maxWidth/2 - NSWidth(windowFrame)/2);
origin.y = maxY - NSHeight(windowFrame);
origin.y -= kBubbleOffsetY;
[[self window] setFrameOrigin:origin];
}
......
// Copyright (c) 2011 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_UI_COCOA_FULLSCREEN_EXIT_BUBBLE_VIEW_H_
#define CHROME_BROWSER_UI_COCOA_FULLSCREEN_EXIT_BUBBLE_VIEW_H_
#pragma once
#import <Cocoa/Cocoa.h>
// A view that handles painting the background for the Fullscreen Exit Bubble.
@interface FullscreenExitBubbleView : NSView
@end
#endif // CHROME_BROWSER_UI_COCOA_FULLSCREEN_EXIT_BUBBLE_VIEW_H_
// Copyright (c) 2011 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/ui/cocoa/fullscreen_exit_bubble_view.h"
#include "base/memory/scoped_nsobject.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
namespace {
const CGFloat kShadowTop = 20;
const CGFloat kShadowBottom = 50;
const CGFloat kShadowLeft = 50;
const CGFloat kShadowRight = 50;
const CGFloat kShadowBlurRadius = 290;
const CGFloat kShadowAlpha = 0.5;
const CGFloat kBubbleCornerRadius = 8.0;
}
@implementation FullscreenExitBubbleView
- (void)drawRect:(NSRect)rect {
// Make room for the border to be seen.
NSRect bounds = [self bounds];
bounds.size.width -= kShadowLeft + kShadowRight;
bounds.size.height -= kShadowTop + kShadowBottom;
bounds.origin.x += kShadowLeft;
bounds.origin.y += kShadowBottom;
NSBezierPath* bezier = [NSBezierPath bezierPath];
CGFloat radius = kBubbleCornerRadius;
// Start with a rounded rectangle.
[bezier appendBezierPathWithRoundedRect:bounds
xRadius:radius
yRadius:radius];
[bezier closePath];
[[NSColor whiteColor] set];
gfx::ScopedNSGraphicsContextSaveGState scoped_g_state;
scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]);
[shadow setShadowBlurRadius:kShadowBlurRadius];
[shadow setShadowColor:[[NSColor blackColor]
colorWithAlphaComponent:kShadowAlpha]];
[shadow set];
[bezier fill];
}
@end
......@@ -2633,6 +2633,8 @@
'browser/ui/cocoa/framed_browser_window.mm',
'browser/ui/cocoa/fullscreen_exit_bubble_controller.h',
'browser/ui/cocoa/fullscreen_exit_bubble_controller.mm',
'browser/ui/cocoa/fullscreen_exit_bubble_view.h',
'browser/ui/cocoa/fullscreen_exit_bubble_view.mm',
'browser/ui/cocoa/fullscreen_window.h',
'browser/ui/cocoa/fullscreen_window.mm',
'browser/ui/cocoa/global_error_bubble_controller.h',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment