Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 159267: Don't install the incognito badge in anything other than a normal browser win... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <Carbon/Carbon.h> 5 #include <Carbon/Carbon.h>
6 6
7 #include "base/mac_util.h" 7 #include "base/mac_util.h"
8 #include "base/scoped_nsdisable_screen_updates.h" 8 #include "base/scoped_nsdisable_screen_updates.h"
9 #import "base/scoped_nsobject.h" 9 #import "base/scoped_nsobject.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 - (void)removeBar { 913 - (void)removeBar {
914 [self positionOrRemoveBar:NO]; 914 [self positionOrRemoveBar:NO];
915 } 915 }
916 916
917 // If the browser is in incognito mode, install the image view to decorate 917 // If the browser is in incognito mode, install the image view to decorate
918 // the window at the upper right. Use the same base y coordinate as the 918 // the window at the upper right. Use the same base y coordinate as the
919 // tab strip. 919 // tab strip.
920 - (void)installIncognitoBadge { 920 - (void)installIncognitoBadge {
921 if (!browser_->profile()->IsOffTheRecord()) 921 if (!browser_->profile()->IsOffTheRecord())
922 return; 922 return;
923 // Don't install if we're not a normal browser (ie, a popup).
924 if (![self isNormalWindow])
925 return;
923 926
924 static const float kOffset = 4; 927 static const float kOffset = 4;
925 NSString* incognitoPath = [mac_util::MainAppBundle() 928 NSString* incognitoPath = [mac_util::MainAppBundle()
926 pathForResource:@"otr_icon" 929 pathForResource:@"otr_icon"
927 ofType:@"pdf"]; 930 ofType:@"pdf"];
928 scoped_nsobject<NSImage> incognitoImage( 931 scoped_nsobject<NSImage> incognitoImage(
929 [[NSImage alloc] initWithContentsOfFile:incognitoPath]); 932 [[NSImage alloc] initWithContentsOfFile:incognitoPath]);
930 const NSSize imageSize = [incognitoImage size]; 933 const NSSize imageSize = [incognitoImage size];
931 const NSRect tabFrame = [[self tabStripView] frame]; 934 const NSRect tabFrame = [[self tabStripView] frame];
932 NSRect incognitoFrame = tabFrame; 935 NSRect incognitoFrame = tabFrame;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 NSColor* toolbarButtonBorderColor = toolbarButtonIconColor; 1149 NSColor* toolbarButtonBorderColor = toolbarButtonIconColor;
1147 [theme setValue:toolbarButtonBorderColor 1150 [theme setValue:toolbarButtonBorderColor
1148 forAttribute:@"borderColor" 1151 forAttribute:@"borderColor"
1149 style:GTMThemeStyleToolBar 1152 style:GTMThemeStyleToolBar
1150 state:YES]; 1153 state:YES];
1151 1154
1152 return theme; 1155 return theme;
1153 } 1156 }
1154 @end 1157 @end
1155 1158
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698