summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeremya@chromium.org <jeremya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-15 07:28:28 +0000
committerjeremya@chromium.org <jeremya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-15 07:28:28 +0000
commit55c87fae3dafd9a0501077e9fc8ae0dc2b638be1 (patch)
tree725f0e4d69c6960f3f0d518dac68b30946209fe3
parent85804b5f10ea2d1087c6d0ec0caebe3a41e12313 (diff)
downloadchromium_src-55c87fae3dafd9a0501077e9fc8ae0dc2b638be1.zip
chromium_src-55c87fae3dafd9a0501077e9fc8ae0dc2b638be1.tar.gz
chromium_src-55c87fae3dafd9a0501077e9fc8ae0dc2b638be1.tar.bz2
Implement fullscreen info bubble on Win and Mac.
When a site enters fullscreen a bubble should appear, both to give the user the option to exit fullscreen and to inform them that the site has entered fullscreen. This patch implements that behaviour on Windows and Mac. XIB changes: (FullScreenExitBubble.xib) * Added explanatory text field. * Added "allow" and "deny" buttons. * Changed from View into Window. BUG=73923 TEST= Review URL: http://codereview.chromium.org/7740044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105649 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd17
-rw-r--r--chrome/app/nibs/FullscreenExitBubble.xib798
-rw-r--r--chrome/browser/chromeos/login/screen_locker.cc2
-rw-r--r--chrome/browser/chromeos/login/screen_locker_browsertest.cc2
-rw-r--r--chrome/browser/chromeos/media/media_player.cc2
-rw-r--r--chrome/browser/content_settings/content_settings_default_provider.cc1
-rw-r--r--chrome/browser/content_settings/content_settings_policy_provider.cc1
-rw-r--r--chrome/browser/content_settings/content_settings_utils.cc3
-rw-r--r--chrome/browser/content_settings/host_content_settings_map_unittest.cc6
-rw-r--r--chrome/browser/extensions/extension_tabs_apitest.cc4
-rw-r--r--chrome/browser/ui/browser.cc68
-rw-r--r--chrome/browser/ui/browser.h12
-rw-r--r--chrome/browser/ui/browser_browsertest.cc4
-rw-r--r--chrome/browser/ui/browser_init.cc2
-rw-r--r--chrome/browser/ui/browser_window.h7
-rw-r--r--chrome/browser/ui/cocoa/browser_window_cocoa.h7
-rw-r--r--chrome/browser/ui/cocoa/browser_window_cocoa.mm22
-rw-r--r--chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm8
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.h8
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm20
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_private.h3
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_private.mm13
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_unittest.mm8
-rw-r--r--chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm3
-rw-r--r--chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h26
-rw-r--r--chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm150
-rw-r--r--chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm15
-rw-r--r--chrome/browser/ui/cocoa/info_bubble_view.h3
-rw-r--r--chrome/browser/ui/cocoa/info_bubble_view.mm16
-rw-r--r--chrome/browser/ui/cocoa/info_bubble_window.h4
-rw-r--r--chrome/browser/ui/cocoa/info_bubble_window.mm8
-rw-r--r--chrome/browser/ui/cocoa/view_id_util_browsertest.mm2
-rw-r--r--chrome/browser/ui/fullscreen_exit_bubble.cc18
-rw-r--r--chrome/browser/ui/fullscreen_exit_bubble.h24
-rw-r--r--chrome/browser/ui/gtk/browser_window_gtk.cc53
-rw-r--r--chrome/browser/ui/gtk/browser_window_gtk.h3
-rw-r--r--chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc12
-rw-r--r--chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h7
-rw-r--r--chrome/browser/ui/panels/panel.cc10
-rw-r--r--chrome/browser/ui/panels/panel.h7
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc36
-rw-r--r--chrome/browser/ui/views/frame/browser_view.h9
-rw-r--r--chrome/browser/ui/views/fullscreen_exit_bubble_views.cc230
-rw-r--r--chrome/browser/ui/views/fullscreen_exit_bubble_views.h13
-rw-r--r--chrome/browser/ui/webui/options/content_settings_handler.cc4
-rw-r--r--chrome/chrome_browser.gypi1
-rw-r--r--chrome/common/content_settings_types.h1
-rw-r--r--chrome/test/base/test_browser_window.h8
48 files changed, 1276 insertions, 405 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 3f38ae5..d58f567 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -14028,6 +14028,23 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
</if>
+ <!-- Fullscreen Strings -->
+ <message name="IDS_FULLSCREEN_INFOBAR_REQUEST_PERMISSION" desc="Text displayed in the infobar that requests permission for a site to go fullscreen after it has gone fullscreen.">
+ <ph name="FULLSCREEN_ORIGIN">$1<ex>google.com</ex></ph> has gone fullscreen.
+ </message>
+ <message name="IDS_FULLSCREEN_INFOBAR_FILE_PAGE_NAME" desc="Message displayed when a local page goes fullscreen.">
+ This page has gone full screen.
+ </message>
+ <message name="IDS_FULLSCREEN_INFOBAR_USER_ENTERED_FULLSCREEN" desc="Message for the user telling them that they have entered fullscreen mode.">
+ You have gone full screen.
+ </message>
+ <message name="IDS_FULLSCREEN_INFOBAR_ALLOW" desc="Text in the infobar button that grants permission for a site to enter fullscreen without asking the user for permission.">
+ Allow
+ </message>
+ <message name="IDS_FULLSCREEN_INFOBAR_DENY" desc="Text in the infobar button that forces a webpage out of fullscreen mode.">
+ Exit full screen
+ </message>
+
<!-- Register Protocol Handler Strings -->
<message name="IDS_REGISTER_PROTOCOL_HANDLER_MAILTO_NAME" desc="A more user friendly way of describing mailto: links.">
email
diff --git a/chrome/app/nibs/FullscreenExitBubble.xib b/chrome/app/nibs/FullscreenExitBubble.xib
index eade4b3..03846db 100644
--- a/chrome/app/nibs/FullscreenExitBubble.xib
+++ b/chrome/app/nibs/FullscreenExitBubble.xib
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="44"/>
+ <integer value="20"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -38,61 +38,167 @@
<object class="NSCustomObject" id="1004">
<string key="NSClassName">NSApplication</string>
</object>
- <object class="NSCustomView" id="374699732">
- <reference key="NSNextResponder"/>
- <int key="NSvFlags">290</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSCustomView" id="919318747">
- <reference key="NSNextResponder" ref="374699732"/>
- <int key="NSvFlags">258</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTextField" id="271414804">
- <reference key="NSNextResponder" ref="919318747"/>
- <int key="NSvFlags">290</int>
- <string key="NSFrame">{{8, 8}, {446, 22}}</string>
- <reference key="NSSuperview" ref="919318747"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="526614140">
- <int key="NSCellFlags">67239488</int>
- <int key="NSCellFlags2">138414080</int>
- <string key="NSContents">Exit fullscreen text</string>
- <object class="NSFont" key="NSSupport">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">18</double>
- <int key="NSfFlags">16</int>
+ <object class="NSCustomObject" id="505725325">
+ <string key="NSClassName">ChromeUILocalizer</string>
+ </object>
+ <object class="NSCustomObject" id="904099127">
+ <string key="NSClassName">GTMUILocalizerAndLayoutTweaker</string>
+ </object>
+ <object class="NSWindowTemplate" id="1005">
+ <int key="NSWindowStyleMask">15</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{427, 647}, {499, 39}}</string>
+ <int key="NSWTFlags">536873984</int>
+ <string key="NSWindowTitle">Window</string>
+ <string key="NSWindowClass">InfoBubbleWindow</string>
+ <nil key="NSViewClass"/>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ <object class="NSView" key="NSWindowView" id="1006">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomView" id="124264346">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomView" id="1031271207">
+ <reference key="NSNextResponder" ref="124264346"/>
+ <int key="NSvFlags">265</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="436635720">
+ <reference key="NSNextResponder" ref="1031271207"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{102, 1}, {125, 32}}</string>
+ <reference key="NSSuperview" ref="1031271207"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="39119561">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">^IDS_FULLSCREEN_INFOBAR_DENY</string>
+ <object class="NSFont" key="NSSupport" id="199487396">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="436635720"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="292228158">
+ <reference key="NSNextResponder" ref="1031271207"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{27, 1}, {75, 32}}</string>
+ <reference key="NSSuperview" ref="1031271207"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="1040089538">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">^IDS_FULLSCREEN_INFOBAR_ALLOW</string>
+ <reference key="NSSupport" ref="199487396"/>
+ <reference key="NSControlView" ref="292228158"/>
+ <int key="NSButtonFlags">-2033303297</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
</object>
- <reference key="NSControlView" ref="271414804"/>
- <object class="NSColor" key="NSBackgroundColor">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">controlColor</string>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ <string key="NSFrame">{{265, 0}, {234, 39}}</string>
+ <reference key="NSSuperview" ref="124264346"/>
+ <string key="NSClassName">GTMWidthBasedTweaker</string>
+ </object>
+ <object class="NSTextField" id="661293467">
+ <reference key="NSNextResponder" ref="124264346"/>
+ <int key="NSvFlags">-2147483383</int>
+ <string key="NSFrame">{{395, 11}, {94, 17}}</string>
+ <reference key="NSSuperview" ref="124264346"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="809008073">
+ <int key="NSCellFlags">-2079195584</int>
+ <int key="NSCellFlags2">71304192</int>
+ <string key="NSContents">Exit fullscreen</string>
+ <reference key="NSSupport" ref="199487396"/>
+ <reference key="NSControlView" ref="661293467"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textBackgroundColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textColor</string>
+ <object class="NSColor" key="NSColor" id="853051032">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
</object>
</object>
- <object class="NSColor" key="NSTextColor">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">controlTextColor</string>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MAA</bytes>
+ </object>
+ <object class="NSCustomView" id="514080172">
+ <reference key="NSNextResponder" ref="124264346"/>
+ <int key="NSvFlags">268</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextField" id="478354727">
+ <reference key="NSNextResponder" ref="514080172"/>
+ <int key="NSvFlags">290</int>
+ <string key="NSFrame">{{12, 11}, {208, 17}}</string>
+ <reference key="NSSuperview" ref="514080172"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="925678034">
+ <int key="NSCellFlags">67239488</int>
+ <int key="NSCellFlags2">272631808</int>
+ <string key="NSContents">google.com has gone full screen</string>
+ <reference key="NSSupport" ref="199487396"/>
+ <reference key="NSControlView" ref="478354727"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <reference key="NSColor" ref="853051032"/>
+ </object>
+ </object>
</object>
</object>
+ <string key="NSFrameSize">{237, 39}</string>
+ <reference key="NSSuperview" ref="124264346"/>
+ <string key="NSClassName">GTMWidthBasedTweaker</string>
</object>
</object>
+ <string key="NSFrameSize">{499, 39}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <string key="NSClassName">InfoBubbleView</string>
</object>
- <string key="NSFrame">{{0, -2}, {462, 38}}</string>
- <reference key="NSSuperview" ref="374699732"/>
- <string key="NSClassName">FullscreenExitBubbleView</string>
</object>
+ <string key="NSFrameSize">{499, 39}</string>
+ <reference key="NSSuperview"/>
</object>
- <string key="NSFrameSize">{462, 36}</string>
- <reference key="NSSuperview"/>
- <string key="NSClassName">AnimatableView</string>
+ <string key="NSScreenRect">{{0, 0}, {2560, 1578}}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -100,35 +206,107 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">view</string>
+ <string key="label">exitLabelPlaceholder_</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="374699732"/>
+ <reference key="destination" ref="661293467"/>
</object>
- <int key="connectionID">31</int>
+ <int key="connectionID">12</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">delegate_</string>
- <reference key="source" ref="374699732"/>
- <reference key="destination" ref="1001"/>
+ <string key="label">allowButton_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="292228158"/>
</object>
- <int key="connectionID">33</int>
+ <int key="connectionID">13</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">delegate</string>
- <reference key="source" ref="271414804"/>
- <reference key="destination" ref="1001"/>
+ <string key="label">denyButton_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="436635720"/>
</object>
- <int key="connectionID">38</int>
+ <int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">exitLabelPlaceholder_</string>
+ <string key="label">window</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">16</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">allow:</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="271414804"/>
+ <reference key="destination" ref="292228158"/>
</object>
- <int key="connectionID">45</int>
+ <int key="connectionID">17</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">deny:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="436635720"/>
+ </object>
+ <int key="connectionID">18</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">bubble_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="124264346"/>
+ </object>
+ <int key="connectionID">19</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">localizer_</string>
+ <reference key="source" ref="904099127"/>
+ <reference key="destination" ref="505725325"/>
+ </object>
+ <int key="connectionID">23</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">uiObject_</string>
+ <reference key="source" ref="904099127"/>
+ <reference key="destination" ref="124264346"/>
+ </object>
+ <int key="connectionID">26</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">tweaker_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="904099127"/>
+ </object>
+ <int key="connectionID">27</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">viewToResize_</string>
+ <reference key="source" ref="514080172"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">30</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">viewToResize_</string>
+ <reference key="source" ref="1031271207"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">31</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">messageLabel_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="478354727"/>
+ </object>
+ <int key="connectionID">43</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -159,36 +337,122 @@
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
- <int key="objectID">30</int>
- <reference key="object" ref="374699732"/>
+ <int key="objectID">1</int>
+ <reference key="object" ref="1005"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="919318747"/>
+ <reference ref="1006"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">44</int>
- <reference key="object" ref="919318747"/>
+ <int key="objectID">2</int>
+ <reference key="object" ref="1006"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="271414804"/>
+ <reference ref="124264346"/>
</object>
- <reference key="parent" ref="374699732"/>
+ <reference key="parent" ref="1005"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">36</int>
- <reference key="object" ref="271414804"/>
+ <int key="objectID">3</int>
+ <reference key="object" ref="124264346"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="526614140"/>
+ <reference ref="1031271207"/>
+ <reference ref="514080172"/>
+ <reference ref="661293467"/>
</object>
- <reference key="parent" ref="919318747"/>
+ <reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">37</int>
- <reference key="object" ref="526614140"/>
- <reference key="parent" ref="271414804"/>
+ <int key="objectID">20</int>
+ <reference key="object" ref="1031271207"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="436635720"/>
+ <reference ref="292228158"/>
+ </object>
+ <reference key="parent" ref="124264346"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="292228158"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1040089538"/>
+ </object>
+ <reference key="parent" ref="1031271207"/>
+ <string key="objectName">Allow</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="1040089538"/>
+ <reference key="parent" ref="292228158"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="436635720"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="39119561"/>
+ </object>
+ <reference key="parent" ref="1031271207"/>
+ <string key="objectName">Exit full screen</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7</int>
+ <reference key="object" ref="39119561"/>
+ <reference key="parent" ref="436635720"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">21</int>
+ <reference key="object" ref="505725325"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">22</int>
+ <reference key="object" ref="904099127"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">28</int>
+ <reference key="object" ref="514080172"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="478354727"/>
+ </object>
+ <reference key="parent" ref="124264346"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">41</int>
+ <reference key="object" ref="478354727"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="925678034"/>
+ </object>
+ <reference key="parent" ref="514080172"/>
+ <string key="objectName">Site info text</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">42</int>
+ <reference key="object" ref="925678034"/>
+ <reference key="parent" ref="478354727"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="661293467"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="809008073"/>
+ </object>
+ <reference key="parent" ref="124264346"/>
+ <string key="objectName">Exit info placeholder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">11</int>
+ <reference key="object" ref="809008073"/>
+ <reference key="parent" ref="661293467"/>
</object>
</object>
</object>
@@ -199,30 +463,78 @@
<string>-1.IBPluginDependency</string>
<string>-2.IBPluginDependency</string>
<string>-3.IBPluginDependency</string>
- <string>30.IBEditorWindowLastContentRect</string>
- <string>30.IBPluginDependency</string>
- <string>30.IBViewEditorWindowController.showingLayoutRectangles</string>
- <string>36.IBPluginDependency</string>
- <string>36.IBViewBoundsToFrameTransform</string>
- <string>37.IBPluginDependency</string>
- <string>44.IBPluginDependency</string>
- <string>44.IBViewBoundsToFrameTransform</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>1.IBViewEditorWindowController.showingLayoutRectangles</string>
+ <string>1.IBWindowTemplateEditedContentRect</string>
+ <string>1.NSWindowTemplate.visibleAtLaunch</string>
+ <string>1.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>10.IBPluginDependency</string>
+ <string>10.IBViewBoundsToFrameTransform</string>
+ <string>11.IBPluginDependency</string>
+ <string>2.IBPluginDependency</string>
+ <string>20.IBPluginDependency</string>
+ <string>20.IBViewBoundsToFrameTransform</string>
+ <string>21.IBPluginDependency</string>
+ <string>22.IBPluginDependency</string>
+ <string>28.IBPluginDependency</string>
+ <string>28.IBViewBoundsToFrameTransform</string>
+ <string>3.IBPluginDependency</string>
+ <string>3.IBViewBoundsToFrameTransform</string>
+ <string>4.IBPluginDependency</string>
+ <string>4.IBViewBoundsToFrameTransform</string>
+ <string>41.IBPluginDependency</string>
+ <string>41.IBViewBoundsToFrameTransform</string>
+ <string>42.IBPluginDependency</string>
+ <string>5.IBPluginDependency</string>
+ <string>6.IBPluginDependency</string>
+ <string>6.IBViewBoundsToFrameTransform</string>
+ <string>7.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{902, 979}, {462, 36}}</string>
+ <string>{{1130, 1457}, {499, 39}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
+ <string>{{1130, 1457}, {499, 39}}</string>
+ <boolean value="NO"/>
+ <string>{196, 240}</string>
+ <string>{{357, 418}, {480, 270}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABDxYAAwdAAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
- <bytes key="NSTransformStruct">P4AAAL+AAABBiAAAwcgAAA</bytes>
+ <bytes key="NSTransformStruct">AUOEgAAAAAAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABCFAAAwfgAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAADCFAAAwhAAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABB2AAAwfgAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -241,62 +553,30 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">49</int>
+ <int key="maxID">43</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
- <string key="className">AnimatableView</string>
- <string key="superclassName">BackgroundGradientView</string>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>delegate_</string>
- <string>resizeDelegate_</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>delegate_</string>
- <string>resizeDelegate_</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBToOneOutletInfo">
- <string key="name">delegate_</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">resizeDelegate_</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- </object>
+ <string key="className">ChromeEventProcessingWindow</string>
+ <string key="superclassName">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">browser/ui/cocoa/animatable_view.h</string>
+ <string key="minorKey">browser/ui/cocoa/chrome_event_processing_window.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
- <string key="className">BackgroundGradientView</string>
- <string key="superclassName">NSView</string>
+ <string key="className">ChromeUILocalizer</string>
+ <string key="superclassName">GTMUILocalizer</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">browser/ui/cocoa/background_gradient_view.h</string>
+ <string key="minorKey">browser/ui/cocoa/ui_localizer.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">FullscreenExitBubbleController</string>
- <string key="superclassName">NSViewController</string>
+ <string key="superclassName">NSWindowController</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
@@ -334,16 +614,20 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>allowButton_</string>
+ <string>bubble_</string>
<string>denyButton_</string>
<string>exitLabelPlaceholder_</string>
- <string>siteInfoLabel_</string>
+ <string>messageLabel_</string>
+ <string>tweaker_</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSButton</string>
+ <string>InfoBubbleView</string>
<string>NSButton</string>
<string>NSTextField</string>
<string>NSTextField</string>
+ <string>GTMUILocalizerAndLayoutTweaker</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
@@ -351,9 +635,11 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>allowButton_</string>
+ <string>bubble_</string>
<string>denyButton_</string>
<string>exitLabelPlaceholder_</string>
- <string>siteInfoLabel_</string>
+ <string>messageLabel_</string>
+ <string>tweaker_</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -362,6 +648,10 @@
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo">
+ <string key="name">bubble_</string>
+ <string key="candidateClassName">InfoBubbleView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
<string key="name">denyButton_</string>
<string key="candidateClassName">NSButton</string>
</object>
@@ -370,9 +660,13 @@
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo">
- <string key="name">siteInfoLabel_</string>
+ <string key="name">messageLabel_</string>
<string key="candidateClassName">NSTextField</string>
</object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">tweaker_</string>
+ <string key="candidateClassName">GTMUILocalizerAndLayoutTweaker</string>
+ </object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -381,24 +675,164 @@
</object>
</object>
<object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
+ <string key="className">GTMUILocalizer</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>otherObjectToLocalize_</string>
+ <string>owner_</string>
+ <string>yetAnotherObjectToLocalize_</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>otherObjectToLocalize_</string>
+ <string>owner_</string>
+ <string>yetAnotherObjectToLocalize_</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">otherObjectToLocalize_</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">owner_</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">yetAnotherObjectToLocalize_</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">../third_party/GTM/Foundation/GTMNSObject+KeyValueObserving.h</string>
+ <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizer.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
+ <string key="className">GTMUILocalizerAndLayoutTweaker</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>localizerOwner_</string>
+ <string>localizer_</string>
+ <string>uiObject_</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>GTMUILocalizer</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>localizerOwner_</string>
+ <string>localizer_</string>
+ <string>uiObject_</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">localizerOwner_</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">localizer_</string>
+ <string key="candidateClassName">GTMUILocalizer</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">uiObject_</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="246069200">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">GTMWidthBasedTweaker</string>
+ <string key="superclassName">NSView</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>viewToResize_</string>
+ <string>viewToSlideAndResize_</string>
+ <string>viewToSlide_</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>NSView</string>
+ <string>NSView</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>viewToResize_</string>
+ <string>viewToSlideAndResize_</string>
+ <string>viewToSlide_</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">viewToResize_</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">viewToSlideAndResize_</string>
+ <string key="candidateClassName">NSView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">viewToSlide_</string>
+ <string key="candidateClassName">NSView</string>
+ </object>
+ </object>
+ </object>
+ <reference key="sourceIdentifier" ref="246069200"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">InfoBubbleView</string>
+ <string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">browser/renderer_host/accelerated_plugin_view_mac.h</string>
+ <string key="minorKey">browser/ui/cocoa/info_bubble_view.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">InfoBubbleWindow</string>
+ <string key="superclassName">ChromeEventProcessingWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/ui/cocoa/info_bubble_window.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">browser/ui/cocoa/objc_zombie.h</string>
+ <string key="minorKey">../third_party/GTM/Foundation/GTMNSObject+KeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
@@ -416,6 +850,13 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">common/mac/objc_zombie.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
@@ -429,15 +870,18 @@
<string key="minorKey">browser/ui/cocoa/view_id_util.h</string>
</object>
</object>
- </object>
- <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
- <bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
- <string key="className">FullscreenExitBubbleView</string>
- <string key="superclassName">BackgroundGradientView</string>
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/ui/cocoa/framed_browser_window.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBDocumentRelativeSource</string>
- <string key="minorKey">../../browser/ui/cocoa/fullscreen_exit_bubble_view.h</string>
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/ui/cocoa/themed_window.h</string>
</object>
</object>
</object>
@@ -454,21 +898,21 @@
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<string key="superclassName">NSResponder</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="94936516">
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="71858247">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="520242494">
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="478347663">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="745176575">
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="328701034">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
</object>
@@ -496,6 +940,14 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSButtonCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSCell</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -506,7 +958,7 @@
<object class="IBPartialClassDescription">
<string key="className">NSControl</string>
<string key="superclassName">NSView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="655578352">
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1052527164">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
</object>
@@ -522,7 +974,7 @@
<object class="IBPartialClassDescription">
<string key="className">NSMenu</string>
<string key="superclassName">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1001211166">
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="281851925">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
</object>
@@ -557,11 +1009,11 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="94936516"/>
+ <reference key="sourceIdentifier" ref="71858247"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="520242494"/>
+ <reference key="sourceIdentifier" ref="478347663"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
@@ -572,7 +1024,7 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="745176575"/>
+ <reference key="sourceIdentifier" ref="328701034"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
@@ -590,7 +1042,7 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="655578352"/>
+ <reference key="sourceIdentifier" ref="1052527164"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
@@ -615,7 +1067,7 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="437644961">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
</object>
@@ -650,7 +1102,7 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="1001211166"/>
+ <reference key="sourceIdentifier" ref="281851925"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
@@ -780,14 +1232,14 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="935537092">
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="284204776">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="478020692">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
</object>
@@ -1078,35 +1530,47 @@
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<string key="superclassName">NSResponder</string>
- <reference key="sourceIdentifier" ref="935537092"/>
+ <reference key="sourceIdentifier" ref="284204776"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <reference key="sourceIdentifier" ref="437644961"/>
</object>
<object class="IBPartialClassDescription">
- <string key="className">NSViewController</string>
+ <string key="className">NSWindow</string>
<string key="superclassName">NSResponder</string>
- <object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">view</string>
- <string key="NS.object.0">NSView</string>
+ <reference key="sourceIdentifier" ref="478020692"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
</object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <string key="NS.key.0">view</string>
- <object class="IBToOneOutletInfo" key="NS.object.0">
- <string key="name">view</string>
- <string key="candidateClassName">NSView</string>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindowController</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">showWindow:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">showWindow:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">showWindow:</string>
+ <string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSViewController.h</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
- <integer value="1050" key="NS.object.0"/>
- </object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index ef21a0d..489935c 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -1089,7 +1089,7 @@ void ScreenLocker::Show() {
// browser can be NULL if we receive a lock request before the first browser
// window is shown.
if (browser && browser->window()->IsFullscreen()) {
- browser->ToggleFullscreenMode();
+ browser->ToggleFullscreenMode(false);
}
if (!screen_locker_) {
diff --git a/chrome/browser/chromeos/login/screen_locker_browsertest.cc b/chrome/browser/chromeos/login/screen_locker_browsertest.cc
index a22d226..b03517e 100644
--- a/chrome/browser/chromeos/login/screen_locker_browsertest.cc
+++ b/chrome/browser/chromeos/login/screen_locker_browsertest.cc
@@ -225,7 +225,7 @@ IN_PROC_BROWSER_TEST_F(ScreenLockerTest, DISABLED_TestFullscreenExit) {
scoped_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester());
{
Waiter waiter(browser());
- browser()->ToggleFullscreenMode();
+ browser()->ToggleFullscreenMode(false);
waiter.Wait(false /* not locked */, true /* full screen */);
EXPECT_TRUE(browser()->window()->IsFullscreen());
EXPECT_FALSE(tester->IsLocked());
diff --git a/chrome/browser/chromeos/media/media_player.cc b/chrome/browser/chromeos/media/media_player.cc
index 5023364..2d562bc 100644
--- a/chrome/browser/chromeos/media/media_player.cc
+++ b/chrome/browser/chromeos/media/media_player.cc
@@ -177,7 +177,7 @@ void MediaPlayer::SetPlaybackRequest() {
void MediaPlayer::ToggleFullscreen() {
if (mediaplayer_browser_) {
- mediaplayer_browser_->ToggleFullscreenMode();
+ mediaplayer_browser_->ToggleFullscreenMode(false);
}
}
diff --git a/chrome/browser/content_settings/content_settings_default_provider.cc b/chrome/browser/content_settings/content_settings_default_provider.cc
index 418ed3d..46bc349 100644
--- a/chrome/browser/content_settings/content_settings_default_provider.cc
+++ b/chrome/browser/content_settings/content_settings_default_provider.cc
@@ -37,6 +37,7 @@ const ContentSetting kDefaultSettings[] = {
CONTENT_SETTING_ASK, // CONTENT_SETTINGS_TYPE_NOTIFICATIONS
CONTENT_SETTING_ASK, // CONTENT_SETTINGS_TYPE_INTENTS
CONTENT_SETTING_ASK, // CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE
+ CONTENT_SETTING_ASK, // CONTENT_SETTINGS_TYPE_FULLSCREEN
};
COMPILE_ASSERT(arraysize(kDefaultSettings) == CONTENT_SETTINGS_NUM_TYPES,
default_settings_incorrect_size);
diff --git a/chrome/browser/content_settings/content_settings_policy_provider.cc b/chrome/browser/content_settings/content_settings_policy_provider.cc
index 8ffea40..d74d0b1 100644
--- a/chrome/browser/content_settings/content_settings_policy_provider.cc
+++ b/chrome/browser/content_settings/content_settings_policy_provider.cc
@@ -32,6 +32,7 @@ const char* kPrefToManageType[CONTENT_SETTINGS_NUM_TYPES] = {
prefs::kManagedDefaultNotificationsSetting,
NULL, // No policy for default value of content type intents
NULL, // No policy for default value of content type auto-select-certificate
+ NULL, // No policy for default value of fullscreen requests
};
struct PrefsForManagedContentSettingsMapEntry {
diff --git a/chrome/browser/content_settings/content_settings_utils.cc b/chrome/browser/content_settings/content_settings_utils.cc
index 25b38cf..e5f8a6e6 100644
--- a/chrome/browser/content_settings/content_settings_utils.cc
+++ b/chrome/browser/content_settings/content_settings_utils.cc
@@ -24,7 +24,8 @@ const char* kTypeNames[] = {
"geolocation",
"notifications",
"intents",
- "auto-select-certificate"
+ "auto-select-certificate",
+ "fullscreen"
};
COMPILE_ASSERT(arraysize(kTypeNames) == CONTENT_SETTINGS_NUM_TYPES,
type_names_incorrect_size);
diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
index 53fce95..610c1b7 100644
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -157,6 +157,8 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
CONTENT_SETTING_ASK;
desired_settings.settings[CONTENT_SETTINGS_TYPE_INTENTS] =
CONTENT_SETTING_ASK;
+ desired_settings.settings[CONTENT_SETTINGS_TYPE_FULLSCREEN] =
+ CONTENT_SETTING_ASK;
ContentSettings settings =
host_content_settings_map->GetContentSettings(host, host);
EXPECT_TRUE(SettingsEqual(desired_settings, settings));
@@ -609,6 +611,8 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
CONTENT_SETTING_ASK;
desired_settings.settings[CONTENT_SETTINGS_TYPE_INTENTS] =
CONTENT_SETTING_ASK;
+ desired_settings.settings[CONTENT_SETTINGS_TYPE_FULLSCREEN] =
+ CONTENT_SETTING_ASK;
ContentSettings settings =
host_content_settings_map->GetContentSettings(host, host);
EXPECT_TRUE(SettingsEqual(desired_settings, settings));
@@ -626,6 +630,8 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
settings.settings[CONTENT_SETTINGS_TYPE_COOKIES]);
EXPECT_EQ(desired_settings.settings[CONTENT_SETTINGS_TYPE_INTENTS],
settings.settings[CONTENT_SETTINGS_TYPE_INTENTS]);
+ EXPECT_EQ(desired_settings.settings[CONTENT_SETTINGS_TYPE_FULLSCREEN],
+ settings.settings[CONTENT_SETTINGS_TYPE_FULLSCREEN]);
}
TEST_F(HostContentSettingsMapTest, OffTheRecord) {
diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc
index 48cfac5..8dafbb2 100644
--- a/chrome/browser/extensions/extension_tabs_apitest.cc
+++ b/chrome/browser/extensions/extension_tabs_apitest.cc
@@ -181,7 +181,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, TabsOnUpdated) {
IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
MAYBE_FocusWindowDoesNotExitFullscreen) {
- browser()->window()->SetFullscreen(true);
+ browser()->window()->EnterFullscreen(GURL(), false);
bool is_fullscreen = browser()->window()->IsFullscreen();
ASSERT_TRUE(RunExtensionTest("window_update/focus")) << message_;
ASSERT_EQ(is_fullscreen, browser()->window()->IsFullscreen());
@@ -189,7 +189,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
MAYBE_UpdateWindowSizeExitsFullscreen) {
- browser()->window()->SetFullscreen(true);
+ browser()->window()->EnterFullscreen(GURL(), false);
ASSERT_TRUE(RunExtensionTest("window_update/sizing")) << message_;
ASSERT_FALSE(browser()->window()->IsFullscreen());
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index f94fb23..bebe112 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -34,6 +34,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/character_encoding.h"
+#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h"
#include "chrome/browser/debugger/devtools_toggle_action.h"
@@ -753,7 +754,7 @@ TabContents* Browser::OpenApplicationTab(Profile* profile,
// full screen mode in this case?
if (launch_type == ExtensionPrefs::LAUNCH_FULLSCREEN &&
!browser->window()->IsFullscreen())
- browser->ToggleFullscreenMode();
+ browser->ToggleFullscreenMode(false);
return contents;
}
@@ -1654,7 +1655,10 @@ void Browser::ConvertPopupToTabbedBrowser() {
browser->window()->Show();
}
-void Browser::ToggleFullscreenMode() {
+// TODO(koz): Change |for_tab| to an enum.
+void Browser::ToggleFullscreenMode(bool for_tab) {
+ bool entering_fullscreen = !window_->IsFullscreen();
+
#if !defined(OS_MACOSX)
// In kiosk mode, we always want to be fullscreen. When the browser first
// starts we're not yet fullscreen, so let the initial toggle go through.
@@ -1664,12 +1668,23 @@ void Browser::ToggleFullscreenMode() {
#endif
UserMetrics::RecordAction(UserMetricsAction("ToggleFullscreen"));
- window_->SetFullscreen(!window_->IsFullscreen());
+ GURL url;
+ bool ask_permission = false;
+ if (for_tab) {
+ url = GetSelectedTabContents()->GetURL();
+ ask_permission = !url.SchemeIsFile() &&
+ (GetFullscreenSetting(url) == CONTENT_SETTING_ASK);
+ }
+ if (entering_fullscreen) {
+ window_->EnterFullscreen(url, ask_permission);
+ } else {
+ window_->ExitFullscreen();
+ }
// Once the window has become fullscreen it'll call back to
// WindowFullscreenStateChanged(). We don't do this immediately as
- // BrowserWindow::SetFullscreen() asks for bookmark_bar_state_, so we let the
- // BrowserWindow invoke WindowFullscreenStateChanged when appropriate.
+ // BrowserWindow::EnterFullscreen() asks for bookmark_bar_state_, so we let
+ // the BrowserWindow invoke WindowFullscreenStateChanged when appropriate.
// TODO: convert mac to invoke WindowFullscreenStateChanged once it updates
// the necessary state of the frame.
@@ -1686,8 +1701,16 @@ void Browser::NotifyTabOfFullscreenExitIfNecessary() {
}
#if defined(OS_MACOSX)
-void Browser::TogglePresentationMode() {
- window_->SetPresentationMode(!window_->InPresentationMode());
+void Browser::TogglePresentationMode(bool for_tab) {
+ bool entering_fullscreen = !window_->InPresentationMode();
+ GURL url;
+ bool ask_permission = false;
+ if (for_tab) {
+ url = GetSelectedTabContents()->GetURL();
+ ask_permission = !url.SchemeIsFile() &&
+ (GetFullscreenSetting(url) == CONTENT_SETTING_ASK);
+ }
+ window_->SetPresentationMode(entering_fullscreen, url, ask_permission);
WindowFullscreenStateChanged();
}
#endif
@@ -1696,7 +1719,7 @@ void Browser::TogglePresentationMode() {
void Browser::Search() {
// Exit fullscreen to show omnibox.
if (window_->IsFullscreen()) {
- ToggleFullscreenMode();
+ ToggleFullscreenMode(false);
// ToggleFullscreenMode is asynchronous, so we don't have omnibox
// visible at this point. Wait for next event cycle which toggles
// the visibility of omnibox before creating new tab.
@@ -2623,9 +2646,9 @@ void Browser::ExecuteCommandWithDisposition(
case IDC_RESTORE_TAB: RestoreTab(); break;
case IDC_COPY_URL: WriteCurrentURLToClipboard(); break;
case IDC_SHOW_AS_TAB: ConvertPopupToTabbedBrowser(); break;
- case IDC_FULLSCREEN: ToggleFullscreenMode(); break;
+ case IDC_FULLSCREEN: ToggleFullscreenMode(false); break;
#if defined(OS_MACOSX)
- case IDC_PRESENTATION_MODE: TogglePresentationMode(); break;
+ case IDC_PRESENTATION_MODE: TogglePresentationMode(false); break;
#endif
case IDC_EXIT: Exit(); break;
#if defined(OS_CHROMEOS)
@@ -3807,9 +3830,9 @@ void Browser::ToggleFullscreenModeForTab(TabContents* tab,
if (tab_caused_fullscreen_) {
#if defined(OS_MACOSX)
- TogglePresentationMode();
+ TogglePresentationMode(true);
#else
- ToggleFullscreenMode();
+ ToggleFullscreenMode(true);
#endif
} else if (!enter_fullscreen) {
// If currently there is a tab in "tab fullscreen" mode and fullscreen was
@@ -3885,7 +3908,7 @@ void Browser::CrashedPlugin(TabContents* tab, const FilePath& plugin_path) {
void Browser::ExitTabbedFullscreenModeIfNecessary() {
if (tab_caused_fullscreen_)
- ToggleFullscreenMode();
+ ToggleFullscreenMode(false);
else
NotifyTabOfFullscreenExitIfNecessary();
}
@@ -3895,6 +3918,25 @@ void Browser::UpdatePreferredSize(TabContents* source,
window_->UpdatePreferredSize(source, pref_size);
}
+void Browser::OnAcceptFullscreenPermission(const GURL& url) {
+ HostContentSettingsMap* settings_map = profile()->GetHostContentSettingsMap();
+
+ settings_map->SetContentSetting(
+ ContentSettingsPattern::FromString(url.host()),
+ ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_FULLSCREEN,
+ std::string(), CONTENT_SETTING_ALLOW);
+}
+
+void Browser::OnDenyFullscreenPermission() {
+ ExitTabbedFullscreenModeIfNecessary();
+}
+
+ContentSetting Browser::GetFullscreenSetting(const GURL& url) {
+ HostContentSettingsMap* settings_map = profile()->GetHostContentSettingsMap();
+ return settings_map->GetContentSetting(url, url,
+ CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string());
+}
+
///////////////////////////////////////////////////////////////////////////////
// Browser, TabContentsWrapperDelegate implementation:
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 4e453b4..26a9ad4 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -38,6 +38,7 @@
#include "chrome/browser/ui/shell_dialogs.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h"
#include "chrome/browser/ui/toolbar/toolbar_model.h"
+#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_types.h"
#include "chrome/common/extensions/extension_constants.h"
#include "content/browser/tab_contents/page_navigator.h"
@@ -469,7 +470,7 @@ class Browser : public TabHandlerDelegate,
browser::NavigateParams GetSingletonTabNavigateParams(const GURL& url);
// Invoked when the fullscreen state of the window changes.
- // BrowserWindow::SetFullscreen invokes this after the window has become
+ // BrowserWindow::EnterFullscreen invokes this after the window has become
// fullscreen.
void WindowFullscreenStateChanged();
@@ -508,9 +509,9 @@ class Browser : public TabHandlerDelegate,
void WriteCurrentURLToClipboard();
void ConvertPopupToTabbedBrowser();
// In kiosk mode, the first toggle is valid, the rest is discarded.
- void ToggleFullscreenMode();
+ void ToggleFullscreenMode(bool from_tab);
#if defined(OS_MACOSX)
- void TogglePresentationMode();
+ void TogglePresentationMode(bool from_tab);
#endif
void Exit();
#if defined(OS_CHROMEOS)
@@ -813,6 +814,11 @@ class Browser : public TabHandlerDelegate,
virtual void TabPinnedStateChanged(TabContentsWrapper* contents, int index);
virtual void TabStripEmpty();
+ // Fullscreen permission infobar callbacks.
+ void OnAcceptFullscreenPermission(const GURL& url);
+ void OnDenyFullscreenPermission();
+ ContentSetting GetFullscreenSetting(const GURL& url);
+
// Figure out if there are tabs that have beforeunload handlers.
bool TabsNeedBeforeUnloadFired();
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index 4401f0e..ce05225 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -885,7 +885,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, TabEntersPresentationModeFromWindowed) {
ui_test_utils::WindowedNotificationObserver fullscreen_observer(
chrome::NOTIFICATION_FULLSCREEN_CHANGED,
NotificationService::AllSources());
- browser()->TogglePresentationMode();
+ browser()->TogglePresentationMode(false);
fullscreen_observer.Wait();
ASSERT_FALSE(browser()->window()->IsFullscreen());
ASSERT_FALSE(browser()->window()->InPresentationMode());
@@ -897,7 +897,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, TabEntersPresentationModeFromWindowed) {
ui_test_utils::WindowedNotificationObserver fullscreen_observer(
chrome::NOTIFICATION_FULLSCREEN_CHANGED,
NotificationService::AllSources());
- browser()->ToggleFullscreenMode();
+ browser()->ToggleFullscreenMode(false);
fullscreen_observer.Wait();
ASSERT_TRUE(browser()->window()->IsFullscreen());
ASSERT_FALSE(browser()->window()->InPresentationMode());
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 3e50756..943137b 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -1066,7 +1066,7 @@ Browser* BrowserInit::LaunchWithProfile::OpenTabsInBrowser(
#if !defined(OS_MACOSX)
// In kiosk mode, we want to always be fullscreen, so switch to that now.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode))
- browser->ToggleFullscreenMode();
+ browser->ToggleFullscreenMode(false);
#endif
bool first_tab = true;
diff --git a/chrome/browser/ui/browser_window.h b/chrome/browser/ui/browser_window.h
index 48844a9..bc0f55f 100644
--- a/chrome/browser/ui/browser_window.h
+++ b/chrome/browser/ui/browser_window.h
@@ -136,7 +136,8 @@ class BrowserWindow {
virtual bool IsMinimized() const = 0;
// Accessors for fullscreen mode state.
- virtual void SetFullscreen(bool fullscreen) = 0;
+ virtual void EnterFullscreen(const GURL& url, bool ask_permission) = 0;
+ virtual void ExitFullscreen() = 0;
virtual bool IsFullscreen() const = 0;
// Returns true if the fullscreen bubble is visible.
@@ -303,7 +304,9 @@ class BrowserWindow {
// Sets the presentation mode for the window. If the window is not already in
// fullscreen, also enters fullscreen mode.
- virtual void SetPresentationMode(bool presentation_mode) = 0;
+ virtual void SetPresentationMode(bool presentation_mode,
+ const GURL& url,
+ bool ask_permission) = 0;
virtual bool InPresentationMode() = 0;
#endif
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.h b/chrome/browser/ui/cocoa/browser_window_cocoa.h
index 3352c4af..670445a 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.h
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.h
@@ -55,7 +55,8 @@ class BrowserWindowCocoa : public BrowserWindow,
virtual gfx::Rect GetBounds() const;
virtual bool IsMaximized() const;
virtual bool IsMinimized() const;
- virtual void SetFullscreen(bool fullscreen);
+ virtual void EnterFullscreen(const GURL& url, bool ask_permission);
+ virtual void ExitFullscreen();
virtual bool IsFullscreen() const;
virtual bool IsFullscreenBubbleVisible() const;
virtual LocationBar* GetLocationBar() const;
@@ -105,7 +106,9 @@ class BrowserWindowCocoa : public BrowserWindow,
virtual void Copy();
virtual void Paste();
virtual void OpenTabpose();
- virtual void SetPresentationMode(bool presentation_mode);
+ virtual void SetPresentationMode(bool presentation_mode,
+ const GURL& url,
+ bool ask_permission);
virtual bool InPresentationMode();
virtual void ShowInstant(TabContentsWrapper* preview);
virtual void HideInstant(bool instant_is_active);
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index f2072b8..79fd2e7 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -134,7 +134,7 @@ void BrowserWindowCocoa::ShowInactive() {
void BrowserWindowCocoa::SetBounds(const gfx::Rect& bounds) {
gfx::Rect real_bounds = [controller_ enforceMinWindowSize:bounds];
- SetFullscreen(false);
+ ExitFullscreen();
NSRect cocoa_bounds = NSMakeRect(real_bounds.x(), 0,
real_bounds.width(),
real_bounds.height());
@@ -255,8 +255,16 @@ bool BrowserWindowCocoa::IsMinimized() const {
return [window() isMiniaturized];
}
-void BrowserWindowCocoa::SetFullscreen(bool fullscreen) {
- [controller_ setFullscreen:fullscreen];
+void BrowserWindowCocoa::EnterFullscreen(const GURL& url, bool ask_permission) {
+ [controller_ setFullscreen:YES
+ url:url
+ askPermission:ask_permission];
+}
+
+void BrowserWindowCocoa::ExitFullscreen() {
+ [controller_ setFullscreen:NO
+ url:GURL()
+ askPermission:NO];
}
bool BrowserWindowCocoa::IsFullscreen() const {
@@ -502,8 +510,12 @@ void BrowserWindowCocoa::OpenTabpose() {
[controller_ openTabpose];
}
-void BrowserWindowCocoa::SetPresentationMode(bool presentation_mode) {
- [controller_ setPresentationMode:presentation_mode];
+void BrowserWindowCocoa::SetPresentationMode(bool presentation_mode,
+ const GURL& url,
+ bool ask_permission) {
+ [controller_ setPresentationMode:presentation_mode
+ url:url
+ askPermission:ask_permission];
}
bool BrowserWindowCocoa::InPresentationMode() {
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
index 1d1dc34..3b53ce8 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
@@ -94,7 +94,9 @@ TEST_F(BrowserWindowCocoaTest, TestBookmarkBarVisible) {
@end
@implementation FakeController
-- (void)setFullscreen:(BOOL)fullscreen {
+- (void)setFullscreen:(BOOL)fullscreen
+ url:(const GURL&)url
+ askPermission:(BOOL)askPermission {
fullscreen_ = fullscreen;
}
- (BOOL)isFullscreen {
@@ -114,9 +116,9 @@ TEST_F(BrowserWindowCocoaTest, TestFullscreen) {
scoped_ptr<BrowserWindowCocoaPong> scoped_bwc(bwc);
EXPECT_FALSE(bwc->IsFullscreen());
- bwc->SetFullscreen(true);
+ bwc->EnterFullscreen(GURL(), false);
EXPECT_TRUE(bwc->IsFullscreen());
- bwc->SetFullscreen(false);
+ bwc->ExitFullscreen();
EXPECT_FALSE(bwc->IsFullscreen());
[fake_controller close];
}
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.h b/chrome/browser/ui/cocoa/browser_window_controller.h
index fa2bd91..ec71cd21 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.h
+++ b/chrome/browser/ui/cocoa/browser_window_controller.h
@@ -361,7 +361,9 @@ class TabContents;
// Enters (or exits) fullscreen mode. This method is safe to call on all OS
// versions.
-- (void)setFullscreen:(BOOL)fullscreen;
+- (void)setFullscreen:(BOOL)fullscreen
+ url:(const GURL&)url
+ askPermission:(BOOL)askPermission;
// Returns fullscreen state. This method is safe to call on all OS versions.
- (BOOL)isFullscreen;
@@ -374,7 +376,9 @@ class TabContents;
// Enters (or exits) presentation mode. Also enters fullscreen mode if this
// window is not already fullscreen. This method is safe to call on all OS
// versions.
-- (void)setPresentationMode:(BOOL)presentationMode;
+- (void)setPresentationMode:(BOOL)presentationMode
+ url:(const GURL&)url
+ askPermission:(BOOL)askPermission;
// Returns presentation mode state. This method is safe to call on all OS
// versions.
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 84e053d..382904e 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1913,7 +1913,9 @@ willAnimateFromState:(bookmarks::VisualState)oldState
// "Enter Full Screen" menu item. On Snow Leopard, this function is never
// called by the UI directly, but it provides the implementation for
// |-setPresentationMode:|.
-- (void)setFullscreen:(BOOL)fullscreen {
+- (void)setFullscreen:(BOOL)fullscreen
+ url:(const GURL&)url
+ askPermission:(BOOL)askPermission {
if (fullscreen == [self isFullscreen])
return;
@@ -1931,8 +1933,9 @@ willAnimateFromState:(bookmarks::VisualState)oldState
[self exitFullscreenForSnowLeopardOrEarlier];
}
- if (fullscreen) {
- [self showFullscreenExitBubbleIfNecessary];
+ if (fullscreen && !url.is_empty()) {
+ [self showFullscreenExitBubbleIfNecessaryWithURL:url
+ askPermission:askPermission];
} else {
[self destroyFullscreenExitBubbleIfNecessary];
}
@@ -1956,11 +1959,15 @@ willAnimateFromState:(bookmarks::VisualState)oldState
// set presentation mode. On Snow Leopard, this function is called by the
// "Enter Presentation Mode" menu item, and triggering presentation mode always
// moves the user into fullscreen mode.
-- (void)setPresentationMode:(BOOL)presentationMode {
+- (void)setPresentationMode:(BOOL)presentationMode
+ url:(const GURL&)url
+ askPermission:(BOOL)askPermission {
// Presentation mode on Leopard and Snow Leopard maps directly to fullscreen
// mode.
if (base::mac::IsOSSnowLeopardOrEarlier()) {
- [self setFullscreen:presentationMode];
+ [self setFullscreen:presentationMode
+ url:url
+ askPermission:askPermission];
return;
}
@@ -1991,7 +1998,8 @@ willAnimateFromState:(bookmarks::VisualState)oldState
[static_cast<FramedBrowserWindow*>(window) toggleSystemFullScreen];
}
- [self showFullscreenExitBubbleIfNecessary];
+ [self showFullscreenExitBubbleIfNecessaryWithURL:url
+ askPermission:askPermission];
} else {
if (enteredPresentationModeFromFullscreen_) {
// The window is currently in fullscreen mode, but the user is choosing to
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.h b/chrome/browser/ui/cocoa/browser_window_controller_private.h
index 0cb3e3f..45ba6e5 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.h
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.h
@@ -44,7 +44,8 @@
- (CGFloat)floatingBarHeight;
// Shows the informational "how to exit fullscreen" bubble.
-- (void)showFullscreenExitBubbleIfNecessary;
+- (void)showFullscreenExitBubbleIfNecessaryWithURL:(const GURL&)url
+ askPermission:(BOOL)askPermission;
- (void)destroyFullscreenExitBubbleIfNecessary;
// Lays out the presentation mode toggle button at the top right corner of the
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index 8ecabb2..c63bc0b 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -256,6 +256,7 @@ willPositionSheet:(NSWindow*)sheet
// presentation mode, it hangs off the top of the screen when the bar is
// hidden. The find bar is unaffected by the side tab positioning.
[findBarCocoaController_ positionFindBarViewAtMaxY:maxY maxWidth:width];
+ [fullscreenExitBubbleController_ positionInWindowAtTop:maxY width:width];
// If in presentation mode, reset |maxY| to top of screen, so that the
// floating bar slides over the things which appear to be in the content area.
@@ -781,7 +782,8 @@ willPositionSheet:(NSWindow*)sheet
: [toolbarController_ view]];
}
-- (void)showFullscreenExitBubbleIfNecessary {
+- (void)showFullscreenExitBubbleIfNecessaryWithURL:(const GURL&)url
+ askPermission:(BOOL)askPermission {
if (!browser_->is_fullscreen_for_tab()) {
return;
}
@@ -790,18 +792,19 @@ willPositionSheet:(NSWindow*)sheet
fullscreenExitBubbleController_.reset(
[[FullscreenExitBubbleController alloc] initWithOwner:self
- browser:browser_.get()]);
+ browser:browser_.get()
+ url:url
+ askPermission:askPermission]);
NSView* contentView = [[self window] contentView];
CGFloat maxWidth = NSWidth([contentView frame]);
CGFloat maxY = NSMaxY([[[self window] contentView] frame]);
[fullscreenExitBubbleController_
positionInWindowAtTop:maxY width:maxWidth];
- [contentView addSubview:[fullscreenExitBubbleController_ view]
- positioned:NSWindowAbove relativeTo:[self tabContentArea]];
+ [fullscreenExitBubbleController_ showWindow];
}
- (void)destroyFullscreenExitBubbleIfNecessary {
- [[fullscreenExitBubbleController_ view] removeFromSuperview];
+ [fullscreenExitBubbleController_ close];
fullscreenExitBubbleController_.reset();
}
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
index f11ab51..3e86d66 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
@@ -689,9 +689,9 @@ static bool IsFrontWindow(NSWindow *window) {
TEST_F(BrowserWindowFullScreenControllerTest, TestFullscreenNotLion) {
EXPECT_FALSE([controller_ isFullscreen]);
- [controller_ setFullscreen:YES];
+ [controller_ setFullscreen:YES url:GURL() askPermission:NO];
EXPECT_TRUE([controller_ isFullscreen]);
- [controller_ setFullscreen:NO];
+ [controller_ setFullscreen:NO url:GURL() askPermission:NO];
EXPECT_FALSE([controller_ isFullscreen]);
}
@@ -705,12 +705,12 @@ TEST_F(BrowserWindowFullScreenControllerTest, TestActivateNotLion) {
[controller_ activate];
EXPECT_TRUE(IsFrontWindow([controller_ window]));
- [controller_ setFullscreen:YES];
+ [controller_ setFullscreen:YES url:GURL() askPermission:NO];
[controller_ activate];
EXPECT_TRUE(IsFrontWindow([controller_ createFullscreenWindow]));
// We have to cleanup after ourselves by unfullscreening.
- [controller_ setFullscreen:NO];
+ [controller_ setFullscreen:NO url:GURL() askPermission:NO];
}
@implementation BrowserWindowControllerFakeFullscreen
diff --git a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm
index 79eb058..32b77af 100644
--- a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm
@@ -57,7 +57,8 @@ TEST_F(ContentSettingBubbleControllerTest, Init) {
for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) {
if (i == CONTENT_SETTINGS_TYPE_NOTIFICATIONS ||
i == CONTENT_SETTINGS_TYPE_INTENTS ||
- i == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE) {
+ i == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE ||
+ i == CONTENT_SETTINGS_TYPE_FULLSCREEN) {
// Notifications, web intents and auto select certificate have no bubble.
continue;
}
diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h
index 07dfc1a..998c9075 100644
--- a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h
+++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h
@@ -8,22 +8,30 @@
#include "base/memory/scoped_nsobject.h"
#include "googleurl/src/gurl.h"
-@class AnimatableView;
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
// fullscreen mode via webkitRequestFullScreen().
@interface FullscreenExitBubbleController :
- NSViewController<NSTextViewDelegate, NSAnimationDelegate> {
+ NSWindowController<NSTextViewDelegate, NSAnimationDelegate> {
@private
BrowserWindowController* owner_; // weak
Browser* browser_; // weak
+ GURL url_;
+ BOOL showButtons_;
@protected
IBOutlet NSTextField* exitLabelPlaceholder_;
+ 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
// text views cannot conveniently be created in IB. The xib file contains
@@ -35,12 +43,18 @@ class Browser;
scoped_nsobject<NSAnimation> hideAnimation_;
};
-- (id)initWithOwner:(BrowserWindowController*)owner browser:(Browser*)browser;
+// Initializes a new InfoBarController.
+- (id)initWithOwner:(BrowserWindowController*)owner
+ browser:(Browser*)browser
+ url:(const GURL&)url
+ askPermission:(BOOL)askPermission;
+
+- (void)allow:(id)sender;
+- (void)deny:(id)sender;
+
+- (void)showWindow;
// Positions the fullscreen exit bubble in the top-center of the window.
- (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth;
-// Returns a pointer to this controller's view, cast as an AnimatableView.
-- (AnimatableView*)animatableView;
-
@end
diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
index b3829bd..e90152c 100644
--- a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
@@ -7,23 +7,37 @@
#include "base/logging.h" // for NOTREACHED()
#include "base/mac/mac_util.h"
#include "base/sys_string_conversions.h"
+#include "base/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
-#import "chrome/browser/ui/cocoa/animatable_view.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#include "chrome/browser/ui/cocoa/event_utils.h"
#import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h"
#import "chrome/browser/ui/cocoa/hyperlink_text_view.h"
+#import "chrome/browser/ui/cocoa/info_bubble_view.h"
+#import "chrome/browser/ui/cocoa/info_bubble_window.h"
#include "grit/generated_resources.h"
#include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
#import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
+#import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
#include "ui/base/models/accelerator_cocoa.h"
#include "ui/base/l10n/l10n_util_mac.h"
-const int kPaddingPx = 8;
-const int kInitialDelayMs = 3800;
-const int kSlideOutDurationMs = 700;
+
+namespace {
+const int kBubbleOffsetY = 10;
+const float kInitialDelay = 3.8;
+const float kHideDuration = 0.7;
+} // namespace
+
+@interface OneClickHyperlinkTextView : HyperlinkTextView
+@end
+@implementation OneClickHyperlinkTextView
+- (BOOL)acceptsFirstMouse:(NSEvent*)event {
+ return YES;
+}
+@end
@interface FullscreenExitBubbleController (PrivateMethods)
// Sets |exitLabel_| based on |exitLabelPlaceholder_|,
@@ -44,25 +58,77 @@ const int kSlideOutDurationMs = 700;
@implementation FullscreenExitBubbleController
-- (id)initWithOwner:(BrowserWindowController*)owner browser:(Browser*)browser {
- if ((self = [super initWithNibName:@"FullscreenExitBubble"
- bundle:base::mac::MainAppBundle()])) {
+- (id)initWithOwner:(BrowserWindowController*)owner
+ browser:(Browser*)browser
+ url:(const GURL&)url
+ askPermission:(BOOL)askPermission {
+ NSString* nibPath =
+ [base::mac::MainAppBundle() pathForResource:@"FullscreenExitBubble"
+ ofType:@"nib"];
+ if ((self = [super initWithWindowNibPath:nibPath owner:self])) {
browser_ = browser;
owner_ = owner;
+ url_ = url;
+ showButtons_ = askPermission;
}
return self;
}
+- (void)allow:(id)sender {
+ [self hideButtons];
+ browser_->OnAcceptFullscreenPermission(url_);
+ [self hideSoon];
+}
+
+- (void)deny:(id)sender {
+ browser_->ToggleFullscreenMode(false);
+}
+
+- (void)hideButtons {
+ [allowButton_ setHidden:YES];
+ [denyButton_ setHidden:YES];
+ [exitLabel_ setHidden:NO];
+}
+
+// We want this to be a child of a browser window. addChildWindow:
+// (called from this function) will bring the window on-screen;
+// unfortunately, [NSWindowController showWindow:] will also bring it
+// on-screen (but will cause unexpected changes to the window's
+// position). We cannot have an addChildWindow: and a subsequent
+// showWindow:. Thus, we have our own version.
+- (void)showWindow {
+ // Completes nib load.
+ InfoBubbleWindow* info_bubble = static_cast<InfoBubbleWindow*>([self window]);
+ [bubble_ setArrowLocation:info_bubble::kNoArrow];
+ [info_bubble setCanBecomeKeyWindow:NO];
+ if (!showButtons_) {
+ [self hideButtons];
+ [self hideSoon];
+ }
+ NSRect windowFrame = [owner_ window].frame;
+ [tweaker_ tweakUI:info_bubble];
+ [self positionInWindowAtTop:NSHeight(windowFrame) width:NSWidth(windowFrame)];
+ [[owner_ window] addChildWindow:info_bubble ordered:NSWindowAbove];
+
+ [info_bubble orderFront:self];
+}
+
- (void)awakeFromNib {
+ DCHECK([[self window] isKindOfClass:[InfoBubbleWindow class]]);
+ NSString* title =
+ l10n_util::GetNSStringF(IDS_FULLSCREEN_INFOBAR_REQUEST_PERMISSION,
+ UTF8ToUTF16(url_.host()));
+ [messageLabel_ setStringValue:title];
[self initializeLabel];
- [self hideSoon];
}
- (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth {
- NSRect bubbleFrame = [[self view] frame];
- bubbleFrame.origin.x = (int)(maxWidth/2 - NSWidth(bubbleFrame)/2);
- bubbleFrame.origin.y = maxY - NSHeight(bubbleFrame);
- [[self view] setFrame:bubbleFrame];
+ NSRect windowFrame = [self window].frame;
+ NSPoint origin;
+ origin.x = (int)(maxWidth/2 - NSWidth(windowFrame)/2);
+ origin.y = maxY - NSHeight(windowFrame);
+ origin.y -= kBubbleOffsetY;
+ [[self window] setFrameOrigin:origin];
}
// Called when someone clicks on the embedded link.
@@ -74,21 +140,12 @@ const int kSlideOutDurationMs = 700;
}
- (void)hideTimerFired:(NSTimer*)timer {
- NSRect endFrame = [[self view] frame];
- endFrame.origin.y += endFrame.size.height;
- endFrame.size.height = 0;
- NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
- [self view], NSViewAnimationTargetKey,
- [NSValue valueWithRect:endFrame], NSViewAnimationEndFrameKey, nil];
-
- NSViewAnimation* animation =
- [[NSViewAnimation alloc]
- initWithViewAnimations:[NSArray arrayWithObjects:dict, nil]];
- [animation gtm_setDuration:kSlideOutDurationMs/1000.0
- eventMask:NSLeftMouseUpMask];
- [animation setDelegate:self];
- [animation startAnimation];
- hideAnimation_.reset(animation);
+ [NSAnimationContext beginGrouping];
+ [[NSAnimationContext currentContext]
+ gtm_setDuration:kHideDuration
+ eventMask:NSLeftMouseUpMask|NSLeftMouseDownMask];
+ [[[self window] animator] setAlphaValue:0.0];
+ [NSAnimationContext endGrouping];
}
- (void)animationDidEnd:(NSAnimation*)animation {
@@ -97,10 +154,6 @@ const int kSlideOutDurationMs = 700;
}
}
-- (AnimatableView*)animatableView {
- return static_cast<AnimatableView*>([self view]);
-}
-
- (void)dealloc {
[hideAnimation_.get() stopAnimation];
[hideTimer_ invalidate];
@@ -116,10 +169,11 @@ const int kSlideOutDurationMs = 700;
// The former doesn't show links in a nice way, but the latter can't be added
// in IB without a containing scroll view, so create the NSTextView
// programmatically.
- exitLabel_.reset([[HyperlinkTextView alloc]
+ exitLabel_.reset([[OneClickHyperlinkTextView alloc]
initWithFrame:[exitLabelPlaceholder_ frame]]);
[exitLabel_.get() setAutoresizingMask:
[exitLabelPlaceholder_ autoresizingMask]];
+ [exitLabel_.get() setHidden:[exitLabelPlaceholder_ isHidden]];
[[exitLabelPlaceholder_ superview]
replaceSubview:exitLabelPlaceholder_ with:exitLabel_.get()];
exitLabelPlaceholder_ = nil; // Now released.
@@ -128,25 +182,31 @@ const int kSlideOutDurationMs = 700;
NSString *message = l10n_util::GetNSStringF(IDS_EXIT_FULLSCREEN_MODE,
base::SysNSStringToUTF16([[self class] keyCommandString]));
+ NSFont* font = [NSFont systemFontOfSize:
+ [NSFont systemFontSizeForControlSize:NSRegularControlSize]];
[(HyperlinkTextView*)exitLabel_.get()
setMessageAndLink:@""
withLink:message
atOffset:0
- font:[NSFont systemFontOfSize:18]
- messageColor:[NSColor whiteColor]
- linkColor:[NSColor whiteColor]];
+ font:font
+ messageColor:[NSColor blackColor]
+ linkColor:[NSColor blueColor]];
+ [exitLabel_.get() setAlignment:NSRightTextAlignment];
- [exitLabel_.get() sizeToFit];
- NSLayoutManager* layoutManager = [exitLabel_.get() layoutManager];
- NSTextContainer* textContainer = [exitLabel_.get() textContainer];
+ NSRect labelFrame = [exitLabel_ frame];
+
+ // NSTextView's sizeToFit: method seems to enjoy wrapping lines. Temporarily
+ // set the size large to force it not to.
+ NSRect windowFrame = [[self window] frame];
+ [exitLabel_ setFrameSize:windowFrame.size];
+ NSLayoutManager* layoutManager = [exitLabel_ layoutManager];
+ NSTextContainer* textContainer = [exitLabel_ textContainer];
[layoutManager ensureLayoutForTextContainer:textContainer];
NSRect textFrame = [layoutManager usedRectForTextContainer:textContainer];
- NSRect frame = [[self view] frame];
- NSSize textSize = textFrame.size;
- frame.size.width = textSize.width + 2 * kPaddingPx;
- [[self view] setFrame:frame];
- textFrame.origin.x = textFrame.origin.y = kPaddingPx;
- [exitLabel_.get() setFrame:textFrame];
+
+ labelFrame.origin.x += NSWidth(labelFrame) - NSWidth(textFrame);
+ labelFrame.size = textFrame.size;
+ [exitLabel_ setFrame:labelFrame];
}
// This looks at the Main Menu and determines what the user has set as the
@@ -198,7 +258,7 @@ const int kSlideOutDurationMs = 700;
- (void)hideSoon {
hideTimer_.reset(
- [[NSTimer scheduledTimerWithTimeInterval:kInitialDelayMs/1000.0
+ [[NSTimer scheduledTimerWithTimeInterval:kInitialDelay
target:self
selector:@selector(hideTimerFired:)
userInfo:nil
diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm
index 9061b9e..34d140c 100644
--- a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm
@@ -35,17 +35,22 @@ class FullscreenExitBubbleControllerTest : public CocoaTest {
CocoaTest::SetUp();
controller_.reset(
- [[FullscreenExitBubbleController alloc] initWithOwner:nil browser:nil]);
- EXPECT_TRUE([controller_ view]);
+ [[FullscreenExitBubbleController alloc] initWithOwner:nil
+ browser:nil
+ url:GURL()
+ askPermission:NO]);
+ EXPECT_TRUE([controller_ window]);
+ }
- [[test_window() contentView] addSubview:[controller_ view]];
+ virtual void TearDown() {
+ [controller_ close];
+ controller_.reset();
+ CocoaTest::TearDown();
}
scoped_nsobject<FullscreenExitBubbleController> controller_;
};
-TEST_VIEW(FullscreenExitBubbleControllerTest, [controller_ view])
-
TEST_F(FullscreenExitBubbleControllerTest, LabelWasReplaced) {
EXPECT_FALSE([controller_ exitLabelPlaceholder]);
EXPECT_TRUE([controller_ exitLabel]);
diff --git a/chrome/browser/ui/cocoa/info_bubble_view.h b/chrome/browser/ui/cocoa/info_bubble_view.h
index fcdca2e..1d5ab28 100644
--- a/chrome/browser/ui/cocoa/info_bubble_view.h
+++ b/chrome/browser/ui/cocoa/info_bubble_view.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -18,6 +18,7 @@ const CGFloat kBubbleArrowXOffset = kBubbleArrowWidth + kBubbleCornerRadius;
enum BubbleArrowLocation {
kTopLeft,
kTopRight,
+ kNoArrow,
};
} // namespace info_bubble
diff --git a/chrome/browser/ui/cocoa/info_bubble_view.mm b/chrome/browser/ui/cocoa/info_bubble_view.mm
index bc12045..39799ef 100644
--- a/chrome/browser/ui/cocoa/info_bubble_view.mm
+++ b/chrome/browser/ui/cocoa/info_bubble_view.mm
@@ -21,7 +21,9 @@
- (void)drawRect:(NSRect)rect {
// Make room for the border to be seen.
NSRect bounds = [self bounds];
- bounds.size.height -= info_bubble::kBubbleArrowHeight;
+ if (arrowLocation_ != info_bubble::kNoArrow) {
+ bounds.size.height -= info_bubble::kBubbleArrowHeight;
+ }
NSBezierPath* bezier = [NSBezierPath bezierPath];
rect.size.height -= info_bubble::kBubbleArrowHeight;
@@ -40,6 +42,8 @@
dX = NSWidth(bounds) - info_bubble::kBubbleArrowXOffset -
info_bubble::kBubbleArrowWidth;
break;
+ case info_bubble::kNoArrow:
+ break;
default:
NOTREACHED();
break;
@@ -47,10 +51,12 @@
NSPoint arrowStart = NSMakePoint(NSMinX(bounds), NSMaxY(bounds));
arrowStart.x += dX;
[bezier moveToPoint:NSMakePoint(arrowStart.x, arrowStart.y)];
- [bezier lineToPoint:NSMakePoint(arrowStart.x +
- info_bubble::kBubbleArrowWidth / 2.0,
- arrowStart.y +
- info_bubble::kBubbleArrowHeight)];
+ if (arrowLocation_ != info_bubble::kNoArrow) {
+ [bezier lineToPoint:NSMakePoint(arrowStart.x +
+ info_bubble::kBubbleArrowWidth / 2.0,
+ arrowStart.y +
+ info_bubble::kBubbleArrowHeight)];
+ }
[bezier lineToPoint:NSMakePoint(arrowStart.x + info_bubble::kBubbleArrowWidth,
arrowStart.y)];
[bezier closePath];
diff --git a/chrome/browser/ui/cocoa/info_bubble_window.h b/chrome/browser/ui/cocoa/info_bubble_window.h
index cf992d7..961d660 100644
--- a/chrome/browser/ui/cocoa/info_bubble_window.h
+++ b/chrome/browser/ui/cocoa/info_bubble_window.h
@@ -18,11 +18,15 @@ class AppNotificationBridge;
// If NO the window will close immediately instead of fading out.
// Default YES.
BOOL delayOnClose_;
+ // If NO the window will never become key.
+ // Default YES.
+ BOOL canBecomeKeyWindow_;
// Bridge to proxy Chrome notifications to the window.
scoped_ptr<AppNotificationBridge> notificationBridge_;
}
@property(nonatomic) BOOL delayOnClose;
+@property(nonatomic) BOOL canBecomeKeyWindow;
// Returns YES if the window is in the process of closing.
// Can't use "windowWillClose" notification because that will be sent
diff --git a/chrome/browser/ui/cocoa/info_bubble_window.mm b/chrome/browser/ui/cocoa/info_bubble_window.mm
index 883e5309..aac87d0 100644
--- a/chrome/browser/ui/cocoa/info_bubble_window.mm
+++ b/chrome/browser/ui/cocoa/info_bubble_window.mm
@@ -94,6 +94,7 @@ class AppNotificationBridge : public NotificationObserver {
@implementation InfoBubbleWindow
@synthesize delayOnClose = delayOnClose_;
+@synthesize canBecomeKeyWindow = canBecomeKeyWindow_;
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(NSUInteger)aStyle
@@ -108,6 +109,7 @@ class AppNotificationBridge : public NotificationObserver {
[self setOpaque:NO];
[self setHasShadow:YES];
delayOnClose_ = YES;
+ canBecomeKeyWindow_ = YES;
notificationBridge_.reset(new AppNotificationBridge(self));
// Start invisible. Will be made visible when ordered front.
@@ -133,10 +135,10 @@ class AppNotificationBridge : public NotificationObserver {
// According to
// http://www.cocoabuilder.com/archive/message/cocoa/2006/6/19/165953,
// NSBorderlessWindowMask windows cannot become key or main. In this
-// case, this is not a desired behavior. As an example, the bubble could have
-// buttons.
+// case, this is not necessarily a desired behavior. As an example, the
+// bubble could have buttons.
- (BOOL)canBecomeKeyWindow {
- return YES;
+ return canBecomeKeyWindow_;
}
// Lets the traffic light buttons on the browser window keep their "active"
diff --git a/chrome/browser/ui/cocoa/view_id_util_browsertest.mm b/chrome/browser/ui/cocoa/view_id_util_browsertest.mm
index e85d6a8..af164da 100644
--- a/chrome/browser/ui/cocoa/view_id_util_browsertest.mm
+++ b/chrome/browser/ui/cocoa/view_id_util_browsertest.mm
@@ -95,7 +95,7 @@ IN_PROC_BROWSER_TEST_F(ViewIDTest, Basic) {
// Flaky on Mac: http://crbug.com/90557.
IN_PROC_BROWSER_TEST_F(ViewIDTest, FLAKY_Fullscreen) {
- browser()->window()->SetFullscreen(true);
+ browser()->window()->EnterFullscreen(GURL(), false);
ASSERT_NO_FATAL_FAILURE(DoTest());
}
diff --git a/chrome/browser/ui/fullscreen_exit_bubble.cc b/chrome/browser/ui/fullscreen_exit_bubble.cc
index a394d90..8bca0a9 100644
--- a/chrome/browser/ui/fullscreen_exit_bubble.cc
+++ b/chrome/browser/ui/fullscreen_exit_bubble.cc
@@ -5,9 +5,9 @@
#include "chrome/browser/ui/fullscreen_exit_bubble.h"
#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/ui/browser.h"
#include "ui/gfx/rect.h"
-const double FullscreenExitBubble::kOpacity = 0.7;
const int FullscreenExitBubble::kPaddingPx = 8;
const int FullscreenExitBubble::kInitialDelayMs = 3800;
const int FullscreenExitBubble::kIdleTimeMs = 2300;
@@ -15,10 +15,10 @@ const int FullscreenExitBubble::kPositionCheckHz = 10;
const int FullscreenExitBubble::kSlideInRegionHeightPx = 4;
const int FullscreenExitBubble::kSlideInDurationMs = 350;
const int FullscreenExitBubble::kSlideOutDurationMs = 700;
+const int FullscreenExitBubble::kPopupTopPx = 15;
-FullscreenExitBubble::FullscreenExitBubble(
- CommandUpdater::CommandUpdaterDelegate* delegate)
- : delegate_(delegate) {
+FullscreenExitBubble::FullscreenExitBubble(Browser* browser)
+ : browser_(browser) {
}
FullscreenExitBubble::~FullscreenExitBubble() {
@@ -86,5 +86,13 @@ void FullscreenExitBubble::CheckMousePosition() {
}
void FullscreenExitBubble::ToggleFullscreen() {
- delegate_->ExecuteCommand(IDC_FULLSCREEN);
+ browser_->ExecuteCommand(IDC_FULLSCREEN);
+}
+
+void FullscreenExitBubble::AcceptFullscreen(const GURL& url) {
+ browser_->OnAcceptFullscreenPermission(url);
+}
+
+void FullscreenExitBubble::CancelFullscreen() {
+ browser_->OnDenyFullscreenPermission();
}
diff --git a/chrome/browser/ui/fullscreen_exit_bubble.h b/chrome/browser/ui/fullscreen_exit_bubble.h
index 0f2c14c..ab4ddb8 100644
--- a/chrome/browser/ui/fullscreen_exit_bubble.h
+++ b/chrome/browser/ui/fullscreen_exit_bubble.h
@@ -9,9 +9,12 @@
#include "base/memory/scoped_ptr.h"
#include "base/timer.h"
#include "chrome/browser/command_updater.h"
+#include "googleurl/src/gurl.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/gfx/point.h"
+class Browser;
+
namespace ui {
class SlideAnimation;
}
@@ -22,18 +25,18 @@ class Rect;
class FullscreenExitBubble : public ui::AnimationDelegate {
public:
- explicit FullscreenExitBubble(
- CommandUpdater::CommandUpdaterDelegate* delegate);
+ explicit FullscreenExitBubble(Browser* browser);
virtual ~FullscreenExitBubble();
protected:
- static const double kOpacity; // Opacity of the bubble, 0.0 - 1.0
static const int kPaddingPx; // Amount of padding around the link
static const int kInitialDelayMs; // Initial time bubble remains onscreen
static const int kIdleTimeMs; // Time before mouse idle triggers hide
static const int kPositionCheckHz; // How fast to check the mouse position
- static const int kSlideInRegionHeightPx;
- // Height of region triggering slide-in
+ static const int kSlideInRegionHeightPx; // Height of region triggering
+ // slide-in
+ static const int kPopupTopPx; // Space between the popup and the top
+ // of the screen.
static const int kSlideInDurationMs; // Duration of slide-in animation
static const int kSlideOutDurationMs; // Duration of slide-out animation
@@ -41,9 +44,7 @@ class FullscreenExitBubble : public ui::AnimationDelegate {
// |ignore_animation_state| is true this returns the rect assuming the popup
// is fully onscreen.
virtual gfx::Rect GetPopupRect(bool ignore_animation_state) const = 0;
-
virtual gfx::Point GetCursorScreenPoint() = 0;
-
virtual bool WindowContainsPoint(gfx::Point pos) = 0;
// Returns true if the window is active.
@@ -65,12 +66,13 @@ class FullscreenExitBubble : public ui::AnimationDelegate {
void StartWatchingMouse();
void ToggleFullscreen();
+ void AcceptFullscreen(const GURL& url);
+ void CancelFullscreen();
- private:
- // Someone who can toggle fullscreen mode on and off when the user requests
- // it.
- CommandUpdater::CommandUpdaterDelegate* delegate_;
+ // The browser this bubble is in.
+ Browser* browser_;
+ private:
// Timer to delay before allowing the bubble to hide after it's initially
// shown.
base::OneShotTimer<FullscreenExitBubble> initial_delay_;
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc
index ca0ff0a..bbf3836 100644
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc
@@ -688,7 +688,7 @@ void BrowserWindowGtk::SetBoundsImpl(const gfx::Rect& bounds,
void BrowserWindowGtk::SetBounds(const gfx::Rect& bounds) {
if (IsFullscreen())
- SetFullscreen(false);
+ ExitFullscreen();
SetBoundsImpl(bounds, true, true);
}
@@ -850,29 +850,38 @@ bool BrowserWindowGtk::ShouldDrawContentDropShadow() {
return !IsMaximized() && UseCustomFrame();
}
-void BrowserWindowGtk::SetFullscreen(bool fullscreen) {
+void BrowserWindowGtk::EnterFullscreen(const GURL& url, bool ask_permission) {
// gtk_window_(un)fullscreen asks the window manager to toggle the EWMH
// for fullscreen windows. Not all window managers support this.
- if (fullscreen) {
- gtk_window_fullscreen(window_);
- } else {
- // Work around a bug where if we try to unfullscreen, metacity immediately
- // fullscreens us again. This is a little flickery and not necessary if
- // there's a gnome-panel, but it's not easy to detect whether there's a
- // panel or not.
- std::string wm_name;
- bool unmaximize_before_unfullscreen = IsMaximized() &&
- ui::GetWindowManagerName(&wm_name) && wm_name == "Metacity";
- if (unmaximize_before_unfullscreen)
- UnMaximize();
-
- gtk_window_unfullscreen(window_);
-
- if (unmaximize_before_unfullscreen)
- gtk_window_maximize(window_);
+ gtk_window_fullscreen(window_);
+ bool is_kiosk =
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode);
+ if (!is_kiosk) {
+ fullscreen_exit_bubble_.reset(new FullscreenExitBubbleGtk(
+ GTK_FLOATING_CONTAINER(render_area_floating_container_),
+ browser(),
+ url,
+ ask_permission));
}
}
+void BrowserWindowGtk::ExitFullscreen() {
+ // Work around a bug where if we try to unfullscreen, metacity immediately
+ // fullscreens us again. This is a little flickery and not necessary if
+ // there's a gnome-panel, but it's not easy to detect whether there's a
+ // panel or not.
+ std::string wm_name;
+ bool unmaximize_before_unfullscreen = IsMaximized() &&
+ ui::GetWindowManagerName(&wm_name) && wm_name == "Metacity";
+ if (unmaximize_before_unfullscreen)
+ UnMaximize();
+
+ gtk_window_unfullscreen(window_);
+
+ if (unmaximize_before_unfullscreen)
+ gtk_window_maximize(window_);
+}
+
bool BrowserWindowGtk::IsFullscreen() const {
return (state_ & GDK_WINDOW_STATE_FULLSCREEN);
}
@@ -1431,10 +1440,12 @@ gboolean BrowserWindowGtk::OnWindowState(GtkWidget* sender,
gtk_widget_hide(bookmark_bar_->widget());
bool is_kiosk =
CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode);
- if (!is_kiosk) {
+ if (!is_kiosk && !fullscreen_exit_bubble_.get()) {
fullscreen_exit_bubble_.reset(new FullscreenExitBubbleGtk(
GTK_FLOATING_CONTAINER(render_area_floating_container_),
- browser()));
+ browser(),
+ GURL(),
+ false));
}
gtk_widget_hide(toolbar_border_);
} else {
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.h b/chrome/browser/ui/gtk/browser_window_gtk.h
index 0a75640..3bb2816 100644
--- a/chrome/browser/ui/gtk/browser_window_gtk.h
+++ b/chrome/browser/ui/gtk/browser_window_gtk.h
@@ -91,7 +91,8 @@ class BrowserWindowGtk : public BrowserWindow,
virtual gfx::Rect GetBounds() const;
virtual bool IsMaximized() const;
virtual bool IsMinimized() const;
- virtual void SetFullscreen(bool fullscreen);
+ virtual void EnterFullscreen(const GURL& url, bool ask_permission);
+ virtual void ExitFullscreen();
virtual bool IsFullscreen() const;
virtual bool IsFullscreenBubbleVisible() const;
virtual LocationBar* GetLocationBar() const;
diff --git a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
index 7437ffe..114006f 100644
--- a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h"
+#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/gtk/gtk_chrome_link_button.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "chrome/browser/ui/gtk/rounded_window.h"
@@ -15,9 +16,13 @@
FullscreenExitBubbleGtk::FullscreenExitBubbleGtk(
GtkFloatingContainer* container,
- CommandUpdater::CommandUpdaterDelegate* delegate)
- : FullscreenExitBubble(delegate),
- container_(container) {
+ Browser* browser,
+ const GURL& url,
+ bool ask_permission)
+ : FullscreenExitBubble(browser),
+ container_(container),
+ url_(url),
+ show_buttons_(ask_permission) {
InitWidgets();
StartWatchingMouse();
}
@@ -43,6 +48,7 @@ void FullscreenExitBubbleGtk::InitWidgets() {
FALSE);
signals_.Connect(link, "clicked", G_CALLBACK(OnLinkClickedThunk), this);
+
link_container_.Own(gtk_util::CreateGtkBorderBin(
link, &ui::kGdkBlack,
kPaddingPx, kPaddingPx, kPaddingPx, kPaddingPx));
diff --git a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h
index b8a4abb..b5f2543 100644
--- a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h
+++ b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h
@@ -21,7 +21,9 @@ class FullscreenExitBubbleGtk : public FullscreenExitBubble {
// We place the bubble in |container|.
FullscreenExitBubbleGtk(
GtkFloatingContainer* container,
- CommandUpdater::CommandUpdaterDelegate* delegate);
+ Browser* delegate,
+ const GURL& url,
+ bool ask_permission);
virtual ~FullscreenExitBubbleGtk();
protected:
@@ -58,6 +60,9 @@ class FullscreenExitBubbleGtk : public FullscreenExitBubble {
base::OneShotTimer<FullscreenExitBubbleGtk> initial_delay_;
ui::GtkSignalRegistrar signals_;
+
+ const GURL& url_;
+ bool show_buttons_;
};
#endif // CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc
index 15eaf0d..fe6a571 100644
--- a/chrome/browser/ui/panels/panel.cc
+++ b/chrome/browser/ui/panels/panel.cc
@@ -246,7 +246,11 @@ bool Panel::IsMinimized() const {
return expansion_state_ != EXPANDED;
}
-void Panel::SetFullscreen(bool fullscreen) {
+void Panel::EnterFullscreen(const GURL& url, bool ask_permission) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ExitFullscreen() {
NOTIMPLEMENTED();
}
@@ -460,7 +464,9 @@ void Panel::OpenTabpose() {
NOTIMPLEMENTED();
}
-void Panel::SetPresentationMode(bool presentation_mode) {
+void Panel::SetPresentationMode(bool presentation_mode,
+ const GURL& url,
+ bool ask_permission) {
NOTIMPLEMENTED();
}
diff --git a/chrome/browser/ui/panels/panel.h b/chrome/browser/ui/panels/panel.h
index 9496990..c70c783 100644
--- a/chrome/browser/ui/panels/panel.h
+++ b/chrome/browser/ui/panels/panel.h
@@ -85,7 +85,8 @@ class Panel : public BrowserWindow, public NotificationObserver {
virtual gfx::Rect GetBounds() const OVERRIDE;
virtual bool IsMaximized() const OVERRIDE;
virtual bool IsMinimized() const OVERRIDE;
- virtual void SetFullscreen(bool fullscreen) OVERRIDE;
+ virtual void EnterFullscreen(const GURL& url, bool ask_permission) OVERRIDE;
+ virtual void ExitFullscreen() OVERRIDE;
virtual bool IsFullscreen() const OVERRIDE;
virtual bool IsFullscreenBubbleVisible() const OVERRIDE;
virtual LocationBar* GetLocationBar() const OVERRIDE;
@@ -143,7 +144,9 @@ class Panel : public BrowserWindow, public NotificationObserver {
virtual void Paste() OVERRIDE;
#if defined(OS_MACOSX)
virtual void OpenTabpose() OVERRIDE;
- virtual void SetPresentationMode(bool presentation_mode) OVERRIDE;
+ virtual void SetPresentationMode(bool presentation_mode,
+ const GURL& url,
+ bool ask_permission) OVERRIDE;
virtual bool InPresentationMode() OVERRIDE;
#endif
virtual void ShowInstant(TabContentsWrapper* preview) OVERRIDE;
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 2279d18..8205d8b 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -598,7 +598,7 @@ void BrowserView::ShowInactive() {
}
void BrowserView::SetBounds(const gfx::Rect& bounds) {
- SetFullscreen(false);
+ ExitFullscreen();
GetWidget()->SetBounds(bounds);
}
@@ -759,16 +759,29 @@ bool BrowserView::IsMinimized() const {
return frame_->IsMinimized();
}
-void BrowserView::SetFullscreen(bool fullscreen) {
- if (IsFullscreen() == fullscreen)
+void BrowserView::EnterFullscreen(const GURL& url, bool ask_permission) {
+ if (IsFullscreen())
return; // Nothing to do.
-#if defined(OS_WIN) && !defined(USE_AURA)
- ProcessFullscreen(fullscreen);
+#if defined(OS_WIN)
+ ProcessFullscreen(true, url, ask_permission);
#else
// On Linux changing fullscreen is async. Ask the window to change it's
// fullscreen state, and when done invoke ProcessFullscreen.
- frame_->SetFullscreen(fullscreen);
+ frame_->SetFullscreen(true);
+#endif
+}
+
+void BrowserView::ExitFullscreen() {
+ if (!IsFullscreen())
+ return; // Nothing to do.
+
+#if defined(OS_WIN)
+ ProcessFullscreen(false, GURL(), false);
+#else
+ // On Linux changing fullscreen is async. Ask the window to change it's
+ // fullscreen state, and when done invoke ProcessFullscreen.
+ frame_->SetFullscreen(false);
#endif
}
@@ -781,7 +794,7 @@ bool BrowserView::IsFullscreenBubbleVisible() const {
}
void BrowserView::FullScreenStateChanged() {
- ProcessFullscreen(IsFullscreen());
+ ProcessFullscreen(IsFullscreen(), GURL(), false);
}
void BrowserView::RestoreFocus() {
@@ -2164,7 +2177,9 @@ bool BrowserView::UpdateChildViewAndLayout(views::View* new_view,
return changed;
}
-void BrowserView::ProcessFullscreen(bool fullscreen) {
+void BrowserView::ProcessFullscreen(bool fullscreen,
+ const GURL& url,
+ bool ask_permission) {
// Reduce jankiness during the following position changes by:
// * Hiding the window until it's in the final position
// * Ignoring all intervening Layout() calls, which resize the webpage and
@@ -2213,8 +2228,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen) {
bool is_kiosk =
CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode);
if (!is_kiosk) {
- fullscreen_bubble_.reset(new FullscreenExitBubbleViews(GetWidget(),
- browser_.get()));
+ fullscreen_bubble_.reset(new FullscreenExitBubbleViews(
+ GetWidget(), browser_.get(), url, ask_permission));
}
} else {
#if defined(OS_WIN) && !defined(USE_AURA)
@@ -2234,7 +2249,6 @@ void BrowserView::ProcessFullscreen(bool fullscreen) {
#endif
}
-
void BrowserView::LoadAccelerators() {
#if defined(USE_AURA)
// TODO(beng):
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index 91db536..0bd8f51 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -254,7 +254,8 @@ class BrowserView : public BrowserBubbleHost,
virtual gfx::Rect GetBounds() const OVERRIDE;
virtual bool IsMaximized() const OVERRIDE;
virtual bool IsMinimized() const OVERRIDE;
- virtual void SetFullscreen(bool fullscreen) OVERRIDE;
+ virtual void EnterFullscreen(const GURL& url, bool ask_permission) OVERRIDE;
+ virtual void ExitFullscreen() OVERRIDE;
virtual bool IsFullscreen() const OVERRIDE;
virtual LocationBar* GetLocationBar() const OVERRIDE;
virtual void SetFocusToLocationBar(bool select_all) OVERRIDE;
@@ -498,7 +499,11 @@ class BrowserView : public BrowserBubbleHost,
// full screen state. On Linux changing the fullscreen state is async, so we
// ask the window to change it's fullscreen state, then when we get
// notification that it succeeded this method is invoked.
- void ProcessFullscreen(bool fullscreen);
+ // If |url| is not empty, it is the URL of the page that requested fullscreen
+ // (via the fullscreen JS API).
+ // |ask_permission| determines whether the user should be asked to allow the
+ // site to remain fullscreen.
+ void ProcessFullscreen(bool fullscreen, const GURL& url, bool ask_permission);
// Copy the accelerator table from the app resources into something we can
// use.
diff --git a/chrome/browser/ui/views/fullscreen_exit_bubble_views.cc b/chrome/browser/ui/views/fullscreen_exit_bubble_views.cc
index c48a456..3fcb352 100644
--- a/chrome/browser/ui/views/fullscreen_exit_bubble_views.cc
+++ b/chrome/browser/ui/views/fullscreen_exit_bubble_views.cc
@@ -7,6 +7,7 @@
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/ui/views/bubble/bubble.h"
#include "grit/generated_resources.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/keycodes/keyboard_codes.h"
@@ -14,6 +15,8 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/screen.h"
+#include "views/bubble/bubble_border.h"
+#include "views/controls/button/text_button.h"
#include "views/controls/link.h"
#include "views/widget/widget.h"
@@ -23,99 +26,199 @@
// FullscreenExitView ----------------------------------------------------------
-class FullscreenExitBubbleViews::FullscreenExitView : public views::View {
+namespace {
+// Space between the site info label and the buttons / link.
+const int kMiddlePaddingPx = 30;
+} // namespace
+
+class FullscreenExitBubbleViews::FullscreenExitView
+ : public views::View,
+ public views::ButtonListener {
public:
FullscreenExitView(FullscreenExitBubbleViews* bubble,
- const std::wstring& accelerator);
+ const string16& accelerator,
+ const GURL& url,
+ bool ask_permission);
virtual ~FullscreenExitView();
// views::View
virtual gfx::Size GetPreferredSize();
+ // views::ButtonListener
+ virtual void ButtonPressed(views::Button* sender, const views::Event& event);
+
+ // Hide the accept and deny buttons, exposing the exit link.
+ void HideButtons();
+
private:
+ string16 GetMessage(const GURL& url);
+
// views::View
virtual void Layout();
- virtual void OnPaint(gfx::Canvas* canvas);
+
+ FullscreenExitBubbleViews* bubble_;
// Clickable hint text to show in the bubble.
views::Link link_;
+ views::Label message_label_;
+ views::NativeTextButton* accept_button_;
+ views::NativeTextButton* deny_button_;
+
+ bool show_buttons_;
};
FullscreenExitBubbleViews::FullscreenExitView::FullscreenExitView(
FullscreenExitBubbleViews* bubble,
- const std::wstring& accelerator) {
+ const string16& accelerator,
+ const GURL& url,
+ bool ask_permission)
+ : bubble_(bubble),
+ accept_button_(NULL),
+ deny_button_(NULL),
+ show_buttons_(ask_permission) {
+ views::BubbleBorder* bubble_border =
+ new views::BubbleBorder(views::BubbleBorder::NONE);
+ bubble_border->set_background_color(Bubble::kBackgroundColor);
+ set_background(new views::BubbleBackground(bubble_border));
+ set_border(bubble_border);
+ set_focusable(false);
+
+ message_label_.set_parent_owned(false);
+ message_label_.SetText(GetMessage(url));
+ message_label_.SetFont(ResourceBundle::GetSharedInstance().GetFont(
+ ResourceBundle::MediumFont));
+
link_.set_parent_owned(false);
+ link_.set_collapse_when_hidden(false);
+ link_.set_focusable(false);
#if !defined(OS_CHROMEOS)
link_.SetText(
l10n_util::GetStringFUTF16(IDS_EXIT_FULLSCREEN_MODE,
- WideToUTF16(accelerator)));
+ accelerator));
#else
link_.SetText(l10n_util::GetStringUTF16(IDS_EXIT_FULLSCREEN_MODE));
#endif
link_.set_listener(bubble);
link_.SetFont(ResourceBundle::GetSharedInstance().GetFont(
- ResourceBundle::LargeFont));
- link_.SetBackgroundColor(SK_ColorBLACK);
- link_.SetEnabledColor(SK_ColorWHITE);
- link_.SetPressedColor(SK_ColorWHITE);
+ ResourceBundle::MediumFont));
+ link_.SetPressedColor(message_label_.enabled_color());
+ link_.SetEnabledColor(message_label_.enabled_color());
+ link_.SetVisible(false);
+
+ link_.SetBackgroundColor(background()->get_color());
+ message_label_.SetBackgroundColor(background()->get_color());
+ AddChildView(&message_label_);
AddChildView(&link_);
+
+ accept_button_ = new views::NativeTextButton(this,
+ UTF16ToWide(l10n_util::GetStringUTF16(IDS_FULLSCREEN_INFOBAR_ALLOW)));
+ accept_button_->set_focusable(false);
+ AddChildView(accept_button_);
+
+ deny_button_ = new views::NativeTextButton(this,
+ UTF16ToWide(l10n_util::GetStringUTF16(IDS_FULLSCREEN_INFOBAR_DENY)));
+ deny_button_->set_focusable(false);
+ AddChildView(deny_button_);
+
+ if (!show_buttons_)
+ HideButtons();
+}
+
+string16 FullscreenExitBubbleViews::FullscreenExitView::GetMessage(
+ const GURL& url) {
+ if (url.is_empty()) {
+ return l10n_util::GetStringUTF16(
+ IDS_FULLSCREEN_INFOBAR_USER_ENTERED_FULLSCREEN);
+ }
+ if (url.SchemeIsFile())
+ return l10n_util::GetStringUTF16(IDS_FULLSCREEN_INFOBAR_FILE_PAGE_NAME);
+ return l10n_util::GetStringFUTF16(IDS_FULLSCREEN_INFOBAR_REQUEST_PERMISSION,
+ UTF8ToUTF16(url.host()));
}
FullscreenExitBubbleViews::FullscreenExitView::~FullscreenExitView() {
}
+void FullscreenExitBubbleViews::FullscreenExitView::ButtonPressed(
+ views::Button* sender, const views::Event& event) {
+ if (sender == accept_button_)
+ bubble_->OnAcceptFullscreen();
+ else
+ bubble_->OnCancelFullscreen();
+}
+
+void FullscreenExitBubbleViews::FullscreenExitView::HideButtons() {
+ show_buttons_ = false;
+ accept_button_->SetVisible(false);
+ deny_button_->SetVisible(false);
+ link_.SetVisible(true);
+}
+
gfx::Size FullscreenExitBubbleViews::FullscreenExitView::GetPreferredSize() {
- gfx::Size preferred_size(link_.GetPreferredSize());
- preferred_size.Enlarge(kPaddingPx * 2, kPaddingPx * 2);
- return preferred_size;
+ gfx::Size link_size(link_.GetPreferredSize());
+ gfx::Size message_label_size(message_label_.GetPreferredSize());
+ gfx::Size accept_size(accept_button_->GetPreferredSize());
+ gfx::Size deny_size(deny_button_->GetPreferredSize());
+ gfx::Insets insets(GetInsets());
+
+ int buttons_width = accept_size.width() + kPaddingPx +
+ deny_size.width();
+ int button_box_width = std::max(buttons_width, link_size.width());
+ int width = kPaddingPx + message_label_size.width() + kMiddlePaddingPx +
+ button_box_width + kPaddingPx;
+
+ gfx::Size result(width + insets.width(),
+ kPaddingPx * 2 + accept_size.height() + insets.height());
+ return result;
}
void FullscreenExitBubbleViews::FullscreenExitView::Layout() {
- gfx::Size link_preferred_size(link_.GetPreferredSize());
- link_.SetBounds(kPaddingPx,
- height() - kPaddingPx - link_preferred_size.height(),
- link_preferred_size.width(), link_preferred_size.height());
-}
-
-void FullscreenExitBubbleViews::FullscreenExitView::OnPaint(
- gfx::Canvas* canvas) {
- // Create a round-bottomed rect to fill the whole View.
- SkRect rect;
- SkScalar padding = SkIntToScalar(kPaddingPx);
- // The "-padding" top coordinate ensures that the rect is always tall enough
- // to contain the complete rounded corner radius. If we set this to 0, as the
- // popup slides offscreen (in reality, squishes to 0 height), the corners will
- // flatten out as the height becomes less than the corner radius.
- rect.set(0, -padding, SkIntToScalar(width()), SkIntToScalar(height()));
- SkScalar rad[8] = { 0, 0, 0, 0, padding, padding, padding, padding };
- SkPath path;
- path.addRoundRect(rect, rad, SkPath::kCW_Direction);
-
- // Fill it black.
- SkPaint paint;
- paint.setStyle(SkPaint::kFill_Style);
- paint.setFlags(SkPaint::kAntiAlias_Flag);
- paint.setColor(SK_ColorBLACK);
- canvas->GetSkCanvas()->drawPath(path, paint);
+ gfx::Size link_size(link_.GetPreferredSize());
+ gfx::Size message_label_size(message_label_.GetPreferredSize());
+ gfx::Size accept_size(accept_button_->GetPreferredSize());
+ gfx::Size deny_size(deny_button_->GetPreferredSize());
+ gfx::Insets insets(GetInsets());
+
+ int inner_height = height() - insets.height();
+ int button_box_x = insets.left() + kPaddingPx +
+ message_label_size.width() + kMiddlePaddingPx;
+ int message_label_y = insets.top() +
+ (inner_height - message_label_size.height()) / 2;
+ int link_x = width() - insets.right() - kPaddingPx -
+ link_size.width();
+ int link_y = insets.top() + (inner_height - link_size.height()) / 2;
+
+ message_label_.SetPosition(gfx::Point(insets.left() + kPaddingPx,
+ message_label_y));
+ link_.SetPosition(gfx::Point(link_x, link_y));
+ if (show_buttons_) {
+ accept_button_->SetPosition(gfx::Point(button_box_x,
+ insets.top() + kPaddingPx));
+ deny_button_->SetPosition(gfx::Point(
+ button_box_x + accept_size.width() + kPaddingPx,
+ insets.top() + kPaddingPx));
+ }
}
// FullscreenExitBubbleViews ---------------------------------------------------
-FullscreenExitBubbleViews::FullscreenExitBubbleViews(
- views::Widget* frame,
- CommandUpdater::CommandUpdaterDelegate* delegate)
- : FullscreenExitBubble(delegate),
+FullscreenExitBubbleViews::FullscreenExitBubbleViews(views::Widget* frame,
+ Browser* browser,
+ const GURL& url,
+ bool ask_permission)
+ : FullscreenExitBubble(browser),
root_view_(frame->GetRootView()),
popup_(NULL),
- size_animation_(new ui::SlideAnimation(this)) {
+ size_animation_(new ui::SlideAnimation(this)),
+ url_(url) {
size_animation_->Reset(1);
// Create the contents view.
views::Accelerator accelerator(ui::VKEY_UNKNOWN, false, false, false);
bool got_accelerator = frame->GetAccelerator(IDC_FULLSCREEN, &accelerator);
DCHECK(got_accelerator);
- view_ = new FullscreenExitView(
- this, UTF16ToWideHack(accelerator.GetShortcutText()));
+ view_ = new FullscreenExitView(this,
+ accelerator.GetShortcutText(), url, ask_permission);
// Initialize the popup.
popup_ = new views::Widget;
@@ -126,11 +229,18 @@ FullscreenExitBubbleViews::FullscreenExitBubbleViews(
params.parent = frame->GetNativeView();
params.bounds = GetPopupRect(false);
popup_->Init(params);
+ gfx::Size size = GetPopupRect(true).size();
popup_->SetContentsView(view_);
- popup_->SetOpacity(static_cast<unsigned char>(0xff * kOpacity));
+ // We set layout manager to NULL to prevent the widget from sizing its
+ // contents to the same size as itself. This prevents the widget contents from
+ // shrinking while we animate the height of the popup to give the impression
+ // that it is sliding off the top of the screen.
+ popup_->GetRootView()->SetLayoutManager(NULL);
+ view_->SetBounds(0, 0, size.width(), size.height());
popup_->Show(); // This does not activate the popup.
- StartWatchingMouse();
+ if (!ask_permission)
+ StartWatchingMouse();
}
FullscreenExitBubbleViews::~FullscreenExitBubbleViews() {
@@ -152,6 +262,16 @@ void FullscreenExitBubbleViews::LinkClicked(
ToggleFullscreen();
}
+void FullscreenExitBubbleViews::OnAcceptFullscreen() {
+ AcceptFullscreen(url_);
+ view_->HideButtons();
+ StartWatchingMouse();
+}
+
+void FullscreenExitBubbleViews::OnCancelFullscreen() {
+ CancelFullscreen();
+}
+
void FullscreenExitBubbleViews::AnimationProgressed(
const ui::Animation* animation) {
gfx::Rect popup_rect(GetPopupRect(false));
@@ -159,9 +279,11 @@ void FullscreenExitBubbleViews::AnimationProgressed(
popup_->Hide();
} else {
popup_->SetBounds(popup_rect);
+ view_->SetY(popup_rect.height() - view_->height());
popup_->Show();
}
}
+
void FullscreenExitBubbleViews::AnimationEnded(
const ui::Animation* animation) {
AnimationProgressed(animation);
@@ -199,16 +321,20 @@ gfx::Point FullscreenExitBubbleViews::GetCursorScreenPoint() {
gfx::Rect FullscreenExitBubbleViews::GetPopupRect(
bool ignore_animation_state) const {
gfx::Size size(view_->GetPreferredSize());
- if (!ignore_animation_state) {
- size.set_height(static_cast<int>(static_cast<double>(size.height()) *
- size_animation_->GetCurrentValue()));
- }
// NOTE: don't use the bounds of the root_view_. On linux changing window
// size is async. Instead we use the size of the screen.
gfx::Rect screen_bounds = gfx::Screen::GetMonitorAreaNearestWindow(
root_view_->GetWidget()->GetNativeView());
gfx::Point origin(screen_bounds.x() +
(screen_bounds.width() - size.width()) / 2,
- screen_bounds.y());
+ kPopupTopPx + screen_bounds.y());
+ if (!ignore_animation_state) {
+ int total_height = size.height() + kPopupTopPx;
+ int popup_bottom = size_animation_->CurrentValueBetween(
+ static_cast<double>(total_height), 0.0f);
+ int y_offset = std::min(popup_bottom, kPopupTopPx);
+ size.set_height(size.height() - popup_bottom + y_offset);
+ origin.set_y(origin.y() - y_offset);
+ }
return gfx::Rect(origin, size);
}
diff --git a/chrome/browser/ui/views/fullscreen_exit_bubble_views.h b/chrome/browser/ui/views/fullscreen_exit_bubble_views.h
index f561cf5..161f2ca 100644
--- a/chrome/browser/ui/views/fullscreen_exit_bubble_views.h
+++ b/chrome/browser/ui/views/fullscreen_exit_bubble_views.h
@@ -8,6 +8,7 @@
#include "base/compiler_specific.h"
#include "chrome/browser/ui/fullscreen_exit_bubble.h"
+#include "googleurl/src/gurl.h"
#include "views/controls/link_listener.h"
namespace views {
@@ -22,11 +23,15 @@ class Widget;
class FullscreenExitBubbleViews : public views::LinkListener,
public FullscreenExitBubble {
public:
- FullscreenExitBubbleViews(
- views::Widget* frame,
- CommandUpdater::CommandUpdaterDelegate* delegate);
+ FullscreenExitBubbleViews(views::Widget* frame,
+ Browser* browser,
+ const GURL& url,
+ bool ask_permission);
virtual ~FullscreenExitBubbleViews();
+ void OnAcceptFullscreen();
+ void OnCancelFullscreen();
+
protected:
// FullScreenExitBubble
virtual gfx::Rect GetPopupRect(bool ignore_animation_state) const OVERRIDE;
@@ -58,6 +63,8 @@ class FullscreenExitBubbleViews : public views::LinkListener,
// The contents of the popup.
FullscreenExitView* view_;
+ const GURL url_;
+
DISALLOW_COPY_AND_ASSIGN(FullscreenExitBubbleViews);
};
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index 30f79d6..03fb36c 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -63,6 +63,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = {
{CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "notifications"},
{CONTENT_SETTINGS_TYPE_INTENTS, "intents"},
{CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "auto-select-certificate"},
+ {CONTENT_SETTINGS_TYPE_FULLSCREEN, "fullscreen"},
};
COMPILE_ASSERT(arraysize(kContentSettingsTypeGroupNames) ==
CONTENT_SETTINGS_NUM_TYPES,
@@ -416,6 +417,9 @@ void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() {
// for this content type and we skip it here.
if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE)
continue;
+ // TODO(koz): Implement fullscreen content settings UI.
+ if (type == CONTENT_SETTINGS_TYPE_FULLSCREEN)
+ continue;
UpdateExceptionsViewFromModel(static_cast<ContentSettingsType>(type));
}
}
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index d5b190e..f52c526 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -4412,6 +4412,7 @@
'app/nibs/ExtensionInstalledBubble.xib',
'app/nibs/FirstRunBubble.xib',
'app/nibs/FirstRunDialog.xib',
+ 'app/nibs/FullScreenExitBubble.xib',
'app/nibs/GlobalErrorBubble.xib',
'app/nibs/HttpAuthLoginSheet.xib',
'app/nibs/HungRendererDialog.xib',
diff --git a/chrome/common/content_settings_types.h b/chrome/common/content_settings_types.h
index cebbc29..3f9602e 100644
--- a/chrome/common/content_settings_types.h
+++ b/chrome/common/content_settings_types.h
@@ -21,6 +21,7 @@ enum ContentSettingsType {
CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
CONTENT_SETTINGS_TYPE_INTENTS,
CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
+ CONTENT_SETTINGS_TYPE_FULLSCREEN,
CONTENT_SETTINGS_NUM_TYPES
};
diff --git a/chrome/test/base/test_browser_window.h b/chrome/test/base/test_browser_window.h
index 76e8375..672390e 100644
--- a/chrome/test/base/test_browser_window.h
+++ b/chrome/test/base/test_browser_window.h
@@ -43,7 +43,9 @@ class TestBrowserWindow : public BrowserWindow {
virtual gfx::Rect GetBounds() const OVERRIDE;
virtual bool IsMaximized() const OVERRIDE;
virtual bool IsMinimized() const OVERRIDE;
- virtual void SetFullscreen(bool fullscreen) OVERRIDE {}
+ virtual void EnterFullscreen(const GURL& url,
+ bool ask_permission) OVERRIDE {}
+ virtual void ExitFullscreen() OVERRIDE {}
virtual bool IsFullscreen() const OVERRIDE;
virtual bool IsFullscreenBubbleVisible() const OVERRIDE;
virtual LocationBar* GetLocationBar() const OVERRIDE;
@@ -100,7 +102,9 @@ class TestBrowserWindow : public BrowserWindow {
virtual void Paste() OVERRIDE {}
#if defined(OS_MACOSX)
virtual void OpenTabpose() OVERRIDE {}
- virtual void SetPresentationMode(bool presentation_mode) OVERRIDE {}
+ virtual void SetPresentationMode(bool presentation_mode,
+ const GURL& url,
+ bool ask_permission) OVERRIDE {}
virtual bool InPresentationMode() OVERRIDE;
#endif