Commit b0871db9 authored by jianli@chromium.org's avatar jianli@chromium.org

Add icon to the panel titlebar on Mac.

Changed Panel.xib to add icon in NSView type.

BUG=none
TEST=manul test to verify it exists

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102326 0039d316-1c4b-4281-b951-d872f2087c98
parent 619864aa
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data> <data>
<int key="IBDocument.SystemTarget">1050</int> <int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10K549</string> <string key="IBDocument.SystemVersion">10J869</string>
<string key="IBDocument.InterfaceBuilderVersion">804</string> <string key="IBDocument.InterfaceBuilderVersion">851</string>
<string key="IBDocument.AppKitVersion">1038.36</string> <string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string> <string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">804</string> <string key="NS.object.0">851</string>
</object> </object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="6"/>
<integer value="1"/> <integer value="1"/>
<integer value="6"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<object class="NSButton" id="514167085"> <object class="NSButton" id="514167085">
<reference key="NSNextResponder" ref="304499912"/> <reference key="NSNextResponder" ref="304499912"/>
<int key="NSvFlags">297</int> <int key="NSvFlags">297</int>
<string key="NSFrame">{{280, 3}, {14, 14}}</string> <string key="NSFrame">{{278, 4}, {14, 14}}</string>
<reference key="NSSuperview" ref="304499912"/> <reference key="NSSuperview" ref="304499912"/>
<bool key="NSViewIsLayerTreeHost">YES</bool> <bool key="NSViewIsLayerTreeHost">YES</bool>
<int key="NSViewLayerContentsRedrawPolicy">2</int> <int key="NSViewLayerContentsRedrawPolicy">2</int>
...@@ -90,13 +90,13 @@ ...@@ -90,13 +90,13 @@
</object> </object>
<object class="NSTextField" id="537532822"> <object class="NSTextField" id="537532822">
<reference key="NSNextResponder" ref="304499912"/> <reference key="NSNextResponder" ref="304499912"/>
<int key="NSvFlags">298</int> <int key="NSvFlags">301</int>
<string key="NSFrame">{{26, 5}, {248, 14}}</string> <string key="NSFrame">{{26, 5}, {248, 14}}</string>
<reference key="NSSuperview" ref="304499912"/> <reference key="NSSuperview" ref="304499912"/>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="947097847"> <object class="NSTextFieldCell" key="NSCell" id="947097847">
<int key="NSCellFlags">68288064</int> <int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">138548224</int> <int key="NSCellFlags2">4330560</int>
<string key="NSContents"/> <string key="NSContents"/>
<reference key="NSSupport" ref="26"/> <reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="537532822"/> <reference key="NSControlView" ref="537532822"/>
...@@ -120,6 +120,35 @@ ...@@ -120,6 +120,35 @@
</object> </object>
</object> </object>
</object> </object>
<object class="NSImageView" id="542139912">
<reference key="NSNextResponder" ref="304499912"/>
<int key="NSvFlags">301</int>
<object class="NSMutableSet" key="NSDragTypes">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="set.sortedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>Apple PDF pasteboard type</string>
<string>Apple PICT pasteboard type</string>
<string>Apple PNG pasteboard type</string>
<string>NSFilenamesPboardType</string>
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
<string>NeXT TIFF v4.0 pasteboard type</string>
</object>
</object>
<string key="NSFrame">{{126, 3}, {14, 14}}</string>
<reference key="NSSuperview" ref="304499912"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="966884311">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">33685504</int>
<reference key="NSSupport" ref="26"/>
<int key="NSAlign">0</int>
<int key="NSScale">0</int>
<int key="NSStyle">0</int>
<bool key="NSAnimates">NO</bool>
</object>
<bool key="NSEditable">YES</bool>
</object>
</object> </object>
<string key="NSFrameSize">{300, 22}</string> <string key="NSFrameSize">{300, 22}</string>
<reference key="NSSuperview"/> <reference key="NSSuperview"/>
...@@ -193,6 +222,14 @@ ...@@ -193,6 +222,14 @@
</object> </object>
<int key="connectionID">18</int> <int key="connectionID">18</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">icon_</string>
<reference key="source" ref="304499912"/>
<reference key="destination" ref="542139912"/>
</object>
<int key="connectionID">21</int>
</object>
</object> </object>
<object class="IBMutableOrderedSet" key="objectRecords"> <object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects"> <object class="NSArray" key="orderedObjects">
...@@ -242,6 +279,7 @@ ...@@ -242,6 +279,7 @@
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="537532822"/> <reference ref="537532822"/>
<reference ref="514167085"/> <reference ref="514167085"/>
<reference ref="542139912"/>
</object> </object>
<reference key="parent" ref="0"/> <reference key="parent" ref="0"/>
<string key="objectName">PanelTitlebarView</string> <string key="objectName">PanelTitlebarView</string>
...@@ -274,6 +312,20 @@ ...@@ -274,6 +312,20 @@
<reference key="object" ref="730890819"/> <reference key="object" ref="730890819"/>
<reference key="parent" ref="514167085"/> <reference key="parent" ref="514167085"/>
</object> </object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="542139912"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="966884311"/>
</object>
<reference key="parent" ref="304499912"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="966884311"/>
<reference key="parent" ref="542139912"/>
</object>
</object> </object>
</object> </object>
<object class="NSMutableDictionary" key="flattenedProperties"> <object class="NSMutableDictionary" key="flattenedProperties">
...@@ -295,7 +347,9 @@ ...@@ -295,7 +347,9 @@
<string>13.IBPluginDependency</string> <string>13.IBPluginDependency</string>
<string>13.IBViewBoundsToFrameTransform</string> <string>13.IBViewBoundsToFrameTransform</string>
<string>14.IBPluginDependency</string> <string>14.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>2.IBPluginDependency</string> <string>2.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
<string>6.IBEditorWindowLastContentRect</string> <string>6.IBEditorWindowLastContentRect</string>
<string>6.IBPluginDependency</string> <string>6.IBPluginDependency</string>
</object> </object>
...@@ -304,9 +358,9 @@ ...@@ -304,9 +358,9 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{1361, 387}, {480, 270}}</string> <string>{{995, 387}, {480, 270}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{1361, 387}, {480, 270}}</string> <string>{{995, 387}, {480, 270}}</string>
<boolean value="NO"/> <boolean value="NO"/>
<string>{196, 240}</string> <string>{196, 240}</string>
<string>{{357, 418}, {480, 270}}</string> <string>{{357, 418}, {480, 270}}</string>
...@@ -319,6 +373,8 @@ ...@@ -319,6 +373,8 @@
</object> </object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{892, 701}, {300, 22}}</string> <string>{{892, 701}, {300, 22}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object> </object>
...@@ -339,17 +395,17 @@ ...@@ -339,17 +395,17 @@
</object> </object>
</object> </object>
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">18</int> <int key="maxID">21</int>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"> <object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions"> <object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription"> <object class="IBPartialClassDescription">
<string key="className">BackgroundGradientView</string> <string key="className">ChromeEventProcessingWindow</string>
<string key="superclassName">NSView</string> <string key="superclassName">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier"> <object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string> <string key="majorKey">IBProjectSource</string>
<string key="minorKey">browser/ui/cocoa/background_gradient_view.h</string> <string key="minorKey">browser/ui/cocoa/chrome_event_processing_window.h</string>
</object> </object>
</object> </object>
<object class="IBPartialClassDescription"> <object class="IBPartialClassDescription">
...@@ -452,7 +508,7 @@ ...@@ -452,7 +508,7 @@
</object> </object>
<object class="IBPartialClassDescription"> <object class="IBPartialClassDescription">
<string key="className">PanelTitlebarViewCocoa</string> <string key="className">PanelTitlebarViewCocoa</string>
<string key="superclassName">BackgroundGradientView</string> <string key="superclassName">NSView</string>
<object class="NSMutableDictionary" key="actions"> <object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys"> <object class="NSArray" key="dict.sortedKeys">
...@@ -490,12 +546,14 @@ ...@@ -490,12 +546,14 @@
<object class="NSArray" key="dict.sortedKeys"> <object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<string>controller_</string> <string>controller_</string>
<string>icon_</string>
<string>settingsButton_</string> <string>settingsButton_</string>
<string>title_</string> <string>title_</string>
</object> </object>
<object class="NSMutableArray" key="dict.values"> <object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<string>PanelWindowControllerCocoa</string> <string>PanelWindowControllerCocoa</string>
<string>NSImageView</string>
<string>HoverImageButton</string> <string>HoverImageButton</string>
<string>NSTextField</string> <string>NSTextField</string>
</object> </object>
...@@ -505,6 +563,7 @@ ...@@ -505,6 +563,7 @@
<object class="NSArray" key="dict.sortedKeys"> <object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<string>controller_</string> <string>controller_</string>
<string>icon_</string>
<string>settingsButton_</string> <string>settingsButton_</string>
<string>title_</string> <string>title_</string>
</object> </object>
...@@ -514,6 +573,10 @@ ...@@ -514,6 +573,10 @@
<string key="name">controller_</string> <string key="name">controller_</string>
<string key="candidateClassName">PanelWindowControllerCocoa</string> <string key="candidateClassName">PanelWindowControllerCocoa</string>
</object> </object>
<object class="IBToOneOutletInfo">
<string key="name">icon_</string>
<string key="candidateClassName">NSImageView</string>
</object>
<object class="IBToOneOutletInfo"> <object class="IBToOneOutletInfo">
<string key="name">settingsButton_</string> <string key="name">settingsButton_</string>
<string key="candidateClassName">HoverImageButton</string> <string key="candidateClassName">HoverImageButton</string>
...@@ -531,7 +594,7 @@ ...@@ -531,7 +594,7 @@
</object> </object>
<object class="IBPartialClassDescription"> <object class="IBPartialClassDescription">
<string key="className">PanelWindowCocoaImpl</string> <string key="className">PanelWindowCocoaImpl</string>
<string key="superclassName">NSWindow</string> <string key="superclassName">ThemedBrowserWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="445655532"> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="445655532">
<string key="majorKey">IBProjectSource</string> <string key="majorKey">IBProjectSource</string>
<string key="minorKey">browser/ui/panels/panel_window_controller_cocoa.h</string> <string key="minorKey">browser/ui/panels/panel_window_controller_cocoa.h</string>
...@@ -561,6 +624,14 @@ ...@@ -561,6 +624,14 @@
<string key="minorKey"/> <string key="minorKey"/>
</object> </object>
</object> </object>
<object class="IBPartialClassDescription">
<string key="className">ThemedBrowserWindow</string>
<string key="superclassName">ChromeEventProcessingWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">browser/ui/cocoa/themed_browser_window.h</string>
</object>
</object>
</object> </object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+"> <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
...@@ -648,6 +719,22 @@ ...@@ -648,6 +719,22 @@
<string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string> <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
</object> </object>
</object> </object>
<object class="IBPartialClassDescription">
<string key="className">NSImageCell</string>
<string key="superclassName">NSCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSImageCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSImageView</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSImageView.h</string>
</object>
</object>
<object class="IBPartialClassDescription"> <object class="IBPartialClassDescription">
<string key="className">NSMenu</string> <string key="className">NSMenu</string>
<string key="superclassName">NSObject</string> <string key="superclassName">NSObject</string>
......
...@@ -35,6 +35,7 @@ enum PanelDragState { ...@@ -35,6 +35,7 @@ enum PanelDragState {
@interface PanelTitlebarViewCocoa : NSView { @interface PanelTitlebarViewCocoa : NSView {
@private @private
IBOutlet PanelWindowControllerCocoa* controller_; IBOutlet PanelWindowControllerCocoa* controller_;
IBOutlet NSImageView* icon_;
IBOutlet NSTextField* title_; IBOutlet NSTextField* title_;
IBOutlet HoverImageButton* settingsButton_; IBOutlet HoverImageButton* settingsButton_;
NSButton* closeButton_; // Created explicitly, not from NIB. Weak, destroyed NSButton* closeButton_; // Created explicitly, not from NIB. Weak, destroyed
...@@ -53,9 +54,11 @@ enum PanelDragState { ...@@ -53,9 +54,11 @@ enum PanelDragState {
- (void)attach; - (void)attach;
- (void)setTitle:(NSString*)newTitle; - (void)setTitle:(NSString*)newTitle;
- (void)setIcon:(NSImage*)newIcon;
// Should be called when size of the titlebar changes. // Should be called when size of the titlebar changes.
- (void)updateCloseButtonLayout; - (void)updateCloseButtonLayout;
- (void)updateIconAndTitleLayout;
// We need to update our look when the Chrome theme changes or window focus // We need to update our look when the Chrome theme changes or window focus
// changes. // changes.
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
const int kRoundedCornerSize = 3; const int kRoundedCornerSize = 3;
const int kCloseButtonLeftPadding = 8; const int kButtonPadding = 8;
const int kIconAndTextPadding = 5;
// Used to implement TestingAPI // Used to implement TestingAPI
static NSEvent* MakeMouseEvent(NSEventType type, static NSEvent* MakeMouseEvent(NSEventType type,
...@@ -184,6 +185,7 @@ static NSEvent* MakeMouseEvent(NSEventType type, ...@@ -184,6 +185,7 @@ static NSEvent* MakeMouseEvent(NSEventType type,
// Update layout of controls in the titlebar. // Update layout of controls in the titlebar.
[self updateCloseButtonLayout]; [self updateCloseButtonLayout];
[self updateIconAndTitleLayout];
// Set autoresizing behavior: glued to edges on left, top and right. // Set autoresizing behavior: glued to edges on left, top and right.
[self setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)]; [self setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)];
...@@ -211,16 +213,16 @@ static NSEvent* MakeMouseEvent(NSEventType type, ...@@ -211,16 +213,16 @@ static NSEvent* MakeMouseEvent(NSEventType type,
[title_ setStringValue:newTitle]; [title_ setStringValue:newTitle];
} }
- (void)setIcon:(NSImage*)newIcon {
[icon_ setImage:newIcon];
}
- (void)updateCloseButtonLayout { - (void)updateCloseButtonLayout {
NSRect buttonBounds = [closeButton_ bounds]; NSRect buttonFrame = [closeButton_ frame];
NSRect bounds = [self bounds]; NSRect bounds = [self bounds];
int x = kCloseButtonLeftPadding; buttonFrame.origin.x = kButtonPadding;
int y = (NSHeight(bounds) - NSHeight(buttonBounds)) / 2; buttonFrame.origin.y = (NSHeight(bounds) - NSHeight(buttonFrame)) / 2;
NSRect buttonFrame = NSMakeRect(x,
y,
NSWidth(buttonBounds),
NSHeight(buttonBounds));
[closeButton_ setFrame:buttonFrame]; [closeButton_ setFrame:buttonFrame];
DCHECK(!closeButtonTrackingArea_.get()); DCHECK(!closeButtonTrackingArea_.get());
...@@ -235,6 +237,34 @@ static NSEvent* MakeMouseEvent(NSEventType type, ...@@ -235,6 +237,34 @@ static NSEvent* MakeMouseEvent(NSEventType type,
[self addTrackingArea:closeButtonTrackingArea_.get()]; [self addTrackingArea:closeButtonTrackingArea_.get()];
} }
- (void)updateIconAndTitleLayout {
NSRect closeButtonFrame = [closeButton_ frame];
NSRect iconFrame = [icon_ frame];
[title_ sizeToFit];
NSRect titleFrame = [title_ frame];
NSRect settingsButtonFrame = [settingsButton_ frame];
NSRect bounds = [self bounds];
// Place the icon and title at the center of the titlebar.
int iconWidthWithPadding = NSWidth(iconFrame) + kIconAndTextPadding;
int titleWidth = NSWidth(titleFrame);
int availableWidth = NSWidth(bounds) - kButtonPadding * 4 -
NSWidth(closeButtonFrame) - NSWidth(settingsButtonFrame);
if (iconWidthWithPadding + titleWidth > availableWidth)
titleWidth = availableWidth - iconWidthWithPadding;
int startX = kButtonPadding * 2 + NSWidth(closeButtonFrame) +
(availableWidth - iconWidthWithPadding - titleWidth) / 2;
iconFrame.origin.x = startX;
iconFrame.origin.y = (NSHeight(bounds) - NSHeight(iconFrame)) / 2;
[icon_ setFrame:iconFrame];
titleFrame.origin.x = startX + iconWidthWithPadding;
titleFrame.origin.y = (NSHeight(bounds) - NSHeight(titleFrame)) / 2;
titleFrame.size.width = titleWidth;
[title_ setFrame:titleFrame];
}
// PanelManager controls size/position of the window. // PanelManager controls size/position of the window.
- (BOOL)mouseDownCanMoveWindow { - (BOOL)mouseDownCanMoveWindow {
return NO; return NO;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#import "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" #import "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h"
#import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" #import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h"
#import "chrome/browser/ui/cocoa/menu_controller.h" #import "chrome/browser/ui/cocoa/menu_controller.h"
#import "chrome/browser/ui/cocoa/tab_contents/favicon_util.h"
#include "chrome/browser/ui/panels/panel.h" #include "chrome/browser/ui/panels/panel.h"
#include "chrome/browser/ui/panels/panel_browser_window_cocoa.h" #include "chrome/browser/ui/panels/panel_browser_window_cocoa.h"
#include "chrome/browser/ui/panels/panel_manager.h" #include "chrome/browser/ui/panels/panel_manager.h"
...@@ -179,6 +180,12 @@ static BOOL g_reportAnimationStatus = NO; ...@@ -179,6 +180,12 @@ static BOOL g_reportAnimationStatus = NO;
withNewTitle:newTitle withNewTitle:newTitle
forWindow:[self window]]); forWindow:[self window]]);
[titlebar_view_ setTitle:newTitle]; [titlebar_view_ setTitle:newTitle];
NSImage* newIcon = mac::FaviconForTabContents(
windowShim_->browser()->GetSelectedTabContentsWrapper());
[titlebar_view_ setIcon:newIcon];
[titlebar_view_ updateIconAndTitleLayout];
} }
- (void)addFindBar:(FindBarCocoaController*)findBarCocoaController { - (void)addFindBar:(FindBarCocoaController*)findBarCocoaController {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment