Commit fa0624b7 authored by mgiuca's avatar mgiuca Committed by Commit bot

Remove Mac Cocoa fullscreen prompt.

This was no longer used (in favour of the Views fullscreen prompt).
Removes ExclusiveAccessBubble.xib, along with classes
ExclusiveAccessBubbleView and ExclusiveAccessBubbleWindowController.

BUG=610900

Review-Url: https://codereview.chromium.org/2001103003
Cr-Commit-Position: refs/heads/master@{#396777}
parent 24873c03
......@@ -12696,11 +12696,6 @@ Some features may be unavailable. Please check that the profile exists and you
<message name="IDS_FULLSCREEN_ENTERED_MOUSELOCK" desc="Text displayed in the bubble to inform the user that the page has locked the mouse. (No domain to be shown, e.g. from filesystem page)">
This page has disabled your mouse cursor.
</message>
<if expr="is_macosx">
<message name="IDS_FULLSCREEN_PRESS_ESC_TO_EXIT_SENTENCE" desc="Text displayed in the bubble to tell users how to return to normal mode.">
Press <ph name="ACCELERATOR">$1<ex>Esc</ex></ph> to exit.
</message>
</if>
<message name="IDS_FULLSCREEN_PRESS_ESC_TO_EXIT_FULLSCREEN" desc="Text displayed in the bubble to tell users how to return from fullscreen mode (where the web page occupies the entire screen) to normal mode. Please surround the name of the key (e.g. 'Esc') in pipe characters so it can be rendered as a key.">
Press |<ph name="ACCELERATOR">$1<ex>Esc</ex></ph>| to exit full screen
</message>
......
......@@ -30,7 +30,6 @@ mac_xib_bundle_data("chrome_xibs") {
"DevicePermissionsPrompt.xib",
"DownloadItem.xib",
"DownloadShelf.xib",
"ExclusiveAccessBubble.xib",
"ExtensionInstallPrompt.xib",
"ExtensionInstallPromptNoWarnings.xib",
"ExtensionInstallPromptWebstoreData.xib",
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13F1077" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1060" identifier="macosx"/>
<development version="5100" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="ExclusiveAccessBubbleWindowController">
<connections>
<outlet property="allowButton_" destination="4" id="13"/>
<outlet property="denyButton_" destination="6" id="14"/>
<outlet property="exitLabelPlaceholder_" destination="10" id="12"/>
<outlet property="messageLabel_" destination="41" id="43"/>
<outlet property="tweaker_" destination="22" id="27"/>
<outlet property="window" destination="1" id="16"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<customObject id="21" customClass="ChromeUILocalizer"/>
<customObject id="22" customClass="GTMUILocalizerAndLayoutTweaker">
<connections>
<outlet property="localizer_" destination="21" id="23"/>
<outlet property="uiObject_" destination="3" id="26"/>
</connections>
</customObject>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" oneShot="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="1" customClass="InfoBubbleWindow">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="427" y="577" width="629" height="109"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1578"/>
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="629" height="109"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<customView id="3" customClass="ExclusiveAccessBubbleView">
<rect key="frame" x="0.0" y="0.0" width="629" height="109"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<customView id="44">
<rect key="frame" x="50" y="50" width="529" height="39"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<customView id="28" customClass="GTMWidthBasedTweaker">
<rect key="frame" x="0.0" y="0.0" width="237" height="39"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" id="41" userLabel="Site info text">
<rect key="frame" x="12" y="11" width="208" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="google.com has gone full screen" id="42">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<connections>
<outlet property="viewToResize_" destination="1" id="30"/>
</connections>
</customView>
<textField hidden="YES" verticalHuggingPriority="750" id="10" userLabel="Exit info placeholder">
<rect key="frame" x="425" y="11" width="94" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" alignment="right" title="Exit fullscreen" id="11">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<customView id="20" customClass="GTMWidthBasedTweaker">
<rect key="frame" x="295" y="0.0" width="234" height="39"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<subviews>
<button verticalHuggingPriority="750" id="4" userLabel="Allow">
<rect key="frame" x="152" y="1" width="75" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="^IDS_FULLSCREEN_ALLOW" bezelStyle="rounded" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="5">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="allow:" target="-2" id="17"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="6" userLabel="Exit full screen">
<rect key="frame" x="27" y="1" width="125" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="7">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="deny:" target="-2" id="18"/>
</connections>
</button>
</subviews>
<connections>
<outlet property="viewToResize_" destination="1" id="31"/>
</connections>
</customView>
</subviews>
</customView>
</subviews>
</customView>
</subviews>
</view>
</window>
</objects>
</document>
......@@ -19,7 +19,6 @@
#include "chrome/browser/translate/chrome_translate_client.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h"
#import "chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h"
#import "chrome/browser/ui/cocoa/themed_window.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.
#ifndef CHROME_BROWSER_UI_COCOA_EXCLUSIVE_ACCESS_BUBBLE_VIEW_H_
#define CHROME_BROWSER_UI_COCOA_EXCLUSIVE_ACCESS_BUBBLE_VIEW_H_
#import <Cocoa/Cocoa.h>
// A view that handles painting the background for the Exclusive Access Bubble.
@interface ExclusiveAccessBubbleView : NSView
@end
#endif // CHROME_BROWSER_UI_COCOA_EXCLUSIVE_ACCESS_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/exclusive_access_bubble_view.h"
#include "base/mac/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 = 30;
const CGFloat kShadowAlpha = 0.5;
const CGFloat kBubbleCornerRadius = 8.0;
}
@implementation ExclusiveAccessBubbleView
- (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;
base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]);
[shadow setShadowBlurRadius:kShadowBlurRadius];
[shadow setShadowColor:[[NSColor blackColor]
colorWithAlphaComponent:kShadowAlpha]];
[shadow set];
[bezier fill];
}
@end
// Copyright (c) 2012 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 <Cocoa/Cocoa.h>
#include "base/mac/scoped_nsobject.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h"
#include "url/gurl.h"
class ExclusiveAccessManager;
class Profile;
@class GTMUILocalizerAndLayoutTweaker;
@class HyperlinkTextView;
// The ExclusiveAccessBubbleWindowController manages the bubble that informs the
// user of different exclusive access state like fullscreen mode, mouse lock,
// etc. Refer to EXCLUSIVE_ACCESS_BUBBLE_TYPE for the different possible
// conntents of the bubble.
@interface ExclusiveAccessBubbleWindowController
: NSWindowController<NSTextViewDelegate, NSAnimationDelegate> {
@private
NSWindowController* owner_; // weak
ExclusiveAccessManager* exclusive_access_manager_; // weak
Profile* profile_; // weak
GURL url_;
ExclusiveAccessBubbleType bubbleType_;
@protected
IBOutlet NSTextField* exitLabelPlaceholder_;
IBOutlet NSTextField* messageLabel_;
IBOutlet NSButton* allowButton_;
IBOutlet NSButton* denyButton_;
IBOutlet GTMUILocalizerAndLayoutTweaker* tweaker_;
// Text fields don't work as well with embedded links as text views, but
// text views cannot conveniently be created in IB. The xib file contains
// a text field |exitLabelPlaceholder_| that's replaced by this text view
// |exitLabel_| in -awakeFromNib.
base::scoped_nsobject<HyperlinkTextView> exitLabel_;
base::scoped_nsobject<NSTimer> hideTimer_;
base::scoped_nsobject<NSAnimation> hideAnimation_;
};
// Initializes a new InfoBarController.
- (id)initWithOwner:(NSWindowController*)owner
exclusive_access_manager:(ExclusiveAccessManager*)exclusive_access_manager
profile:(Profile*)profile
url:(const GURL&)url
bubbleType:(ExclusiveAccessBubbleType)bubbleType;
- (void)allow:(id)sender;
- (void)deny:(id)sender;
- (void)showWindow;
- (void)closeImmediately;
// Positions the exclusive access bubble in the top-center of the window.
- (void)positionInWindowAtTop:(CGFloat)maxY;
@end
// Copyright (c) 2012 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/exclusive_access_bubble_window_controller.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h"
#include "chrome/browser/ui/cocoa/browser_window_controller.h"
#include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/test_utils.h"
#include "testing/gtest_mac.h"
#include "ui/base/accelerators/platform_accelerator_cocoa.h"
#import "ui/base/cocoa/controls/hyperlink_text_view.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_mac.h"
using content::SiteInstance;
using content::WebContents;
@interface ExclusiveAccessBubbleWindowController (JustForTesting)
// Already defined.
+ (NSString*)keyCombinationForAccelerator:
(const ui::PlatformAcceleratorCocoa&)item;
- (void)initializeLabelAndButton;
@end
@interface ExclusiveAccessBubbleWindowController (ExposedForTesting)
- (NSTextField*)exitLabelPlaceholder;
- (NSTextView*)exitLabel;
- (NSString*)denyButtonText;
@end
@implementation ExclusiveAccessBubbleWindowController (ExposedForTesting)
- (NSTextField*)exitLabelPlaceholder {
return exitLabelPlaceholder_;
}
- (HyperlinkTextView*)exitLabel {
return exitLabel_;
}
- (NSString*)denyButtonText {
return [denyButton_ title];
}
@end
class ExclusiveAccessBubbleWindowControllerTest : public CocoaProfileTest {
public:
void SetUp() override {
CocoaProfileTest::SetUp();
ASSERT_TRUE(profile());
site_instance_ = SiteInstance::Create(profile());
controller_.reset([[ExclusiveAccessBubbleWindowController alloc]
initWithOwner:nil
exclusive_access_manager:browser()->exclusive_access_manager()
profile:browser()->profile()
url:GURL()
bubbleType:
EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION]);
EXPECT_TRUE([controller_ window]);
}
void TearDown() override {
[controller_ close];
controller_.reset();
CocoaProfileTest::TearDown();
}
void AppendTabToStrip() {
WebContents* web_contents = WebContents::Create(
content::WebContents::CreateParams(profile(), site_instance_.get()));
browser()->tab_strip_model()->AppendWebContents(web_contents,
/*foreground=*/true);
}
scoped_refptr<SiteInstance> site_instance_;
base::scoped_nsobject<ExclusiveAccessBubbleWindowController> controller_;
};
TEST_F(ExclusiveAccessBubbleWindowControllerTest, LabelWasReplaced) {
EXPECT_FALSE([controller_ exitLabelPlaceholder]);
EXPECT_TRUE([controller_ exitLabel]);
}
TEST_F(ExclusiveAccessBubbleWindowControllerTest, ShortcutText) {
ui::PlatformAcceleratorCocoa cmd_F(@"F", NSCommandKeyMask);
ui::PlatformAcceleratorCocoa cmd_shift_f(@"f",
NSCommandKeyMask | NSShiftKeyMask);
NSString* cmd_F_text = [ExclusiveAccessBubbleWindowController
keyCombinationForAccelerator:cmd_F];
NSString* cmd_shift_f_text = [ExclusiveAccessBubbleWindowController
keyCombinationForAccelerator:cmd_shift_f];
EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text);
EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text);
}
// http://crbug.com/139944
TEST_F(ExclusiveAccessBubbleWindowControllerTest, DenyButtonText) {
controller_.reset([[ExclusiveAccessBubbleWindowController alloc]
initWithOwner:nil
exclusive_access_manager:browser()->exclusive_access_manager()
profile:browser()->profile()
url:GURL()
bubbleType:EXCLUSIVE_ACCESS_BUBBLE_TYPE_MOUSELOCK_BUTTONS]);
[controller_ initializeLabelAndButton];
NSString* mouselock_deny_button_text = [controller_ denyButtonText];
EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_DENY),
mouselock_deny_button_text);
controller_.reset([[ExclusiveAccessBubbleWindowController alloc]
initWithOwner:nil
exclusive_access_manager:browser()->exclusive_access_manager()
profile:browser()->profile()
url:GURL()
bubbleType:
EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS]);
[controller_ initializeLabelAndButton];
NSString* fullscreen_mouselock_deny_button_text =
[controller_ denyButtonText];
EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_EXIT),
fullscreen_mouselock_deny_button_text);
}
......@@ -990,10 +990,6 @@
'browser/ui/cocoa/draggable_button.mm',
'browser/ui/cocoa/draggable_button_mixin.h',
'browser/ui/cocoa/draggable_button_mixin.mm',
'browser/ui/cocoa/exclusive_access_bubble_view.h',
'browser/ui/cocoa/exclusive_access_bubble_view.mm',
'browser/ui/cocoa/exclusive_access_bubble_window_controller.h',
'browser/ui/cocoa/exclusive_access_bubble_window_controller.mm',
'browser/ui/cocoa/extensions/browser_action_button.h',
'browser/ui/cocoa/extensions/browser_action_button.mm',
'browser/ui/cocoa/extensions/browser_actions_container_view.h',
......
......@@ -127,10 +127,6 @@
'browser/ui/cocoa/download/download_show_all_cell.mm',
'browser/ui/cocoa/draggable_button.h',
'browser/ui/cocoa/draggable_button.mm',
'browser/ui/cocoa/exclusive_access_bubble_view.h',
'browser/ui/cocoa/exclusive_access_bubble_view.mm',
'browser/ui/cocoa/exclusive_access_bubble_window_controller.h',
'browser/ui/cocoa/exclusive_access_bubble_window_controller.mm',
'browser/ui/cocoa/extensions/browser_actions_container_view.h',
'browser/ui/cocoa/extensions/browser_actions_container_view.mm',
'browser/ui/cocoa/extensions/device_permissions_view_controller.h',
......
......@@ -31,7 +31,6 @@
'app/nibs/CookieDetailsView.xib',
'app/nibs/DownloadItem.xib',
'app/nibs/DownloadShelf.xib',
'app/nibs/ExclusiveAccessBubble.xib',
'app/nibs/ExtensionInstalledBubble.xib',
'app/nibs/ExtensionInstallPromptNoWarnings.xib',
'app/nibs/ExtensionInstallPromptWebstoreData.xib',
......
......@@ -1225,7 +1225,6 @@
'browser/ui/cocoa/download/download_shelf_view_cocoa_unittest.mm',
'browser/ui/cocoa/download/download_util_mac_unittest.mm',
'browser/ui/cocoa/draggable_button_unittest.mm',
'browser/ui/cocoa/exclusive_access_bubble_window_controller_unittest.mm',
'browser/ui/cocoa/extensions/browser_actions_container_view_unittest.mm',
'browser/ui/cocoa/extensions/extension_install_prompt_test_utils.h',
'browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm',
......
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