OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/l10n_util_mac.h" | 10 #include "app/l10n_util_mac.h" |
| 11 #include "app/mac/scoped_nsdisable_screen_updates.h" |
| 12 #include "app/mac/nsimage_cache.h" |
11 #include "base/mac_util.h" | 13 #include "base/mac_util.h" |
12 #include "app/mac/scoped_nsdisable_screen_updates.h" | |
13 #include "base/nsimage_cache_mac.h" | |
14 #import "base/scoped_nsobject.h" | 14 #import "base/scoped_nsobject.h" |
15 #include "base/sys_string_conversions.h" | 15 #include "base/sys_string_conversions.h" |
16 #include "chrome/app/chrome_command_ids.h" // IDC_* | 16 #include "chrome/app/chrome_command_ids.h" // IDC_* |
17 #include "chrome/browser/bookmarks/bookmark_editor.h" | 17 #include "chrome/browser/bookmarks/bookmark_editor.h" |
18 #include "chrome/browser/google/google_util.h" | 18 #include "chrome/browser/google/google_util.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 20 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
21 #include "chrome/browser/sync/profile_sync_service.h" | 21 #include "chrome/browser/sync/profile_sync_service.h" |
22 #include "chrome/browser/sync/sync_ui_util_mac.h" | 22 #include "chrome/browser/sync/sync_ui_util_mac.h" |
23 #include "chrome/browser/tab_contents/tab_contents.h" | 23 #include "chrome/browser/tab_contents/tab_contents.h" |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 // If the browser is in incognito mode, install the image view to decorate | 1576 // If the browser is in incognito mode, install the image view to decorate |
1577 // the window at the upper right. Use the same base y coordinate as the | 1577 // the window at the upper right. Use the same base y coordinate as the |
1578 // tab strip. | 1578 // tab strip. |
1579 - (void)installIncognitoBadge { | 1579 - (void)installIncognitoBadge { |
1580 // Only install if this browser window is OTR and has a tab strip. | 1580 // Only install if this browser window is OTR and has a tab strip. |
1581 if (!browser_->profile()->IsOffTheRecord() || ![self hasTabStrip]) | 1581 if (!browser_->profile()->IsOffTheRecord() || ![self hasTabStrip]) |
1582 return; | 1582 return; |
1583 | 1583 |
1584 // Install the image into the badge view and size the view appropriately. | 1584 // Install the image into the badge view and size the view appropriately. |
1585 // Hide it for now; positioning and showing will be done by the layout code. | 1585 // Hide it for now; positioning and showing will be done by the layout code. |
1586 NSImage* image = nsimage_cache::ImageNamed(@"otr_icon.pdf"); | 1586 NSImage* image = app::mac::GetCachedImageWithName(@"otr_icon.pdf"); |
1587 incognitoBadge_.reset([[IncognitoImageView alloc] init]); | 1587 incognitoBadge_.reset([[IncognitoImageView alloc] init]); |
1588 [incognitoBadge_ setImage:image]; | 1588 [incognitoBadge_ setImage:image]; |
1589 [incognitoBadge_ setFrameSize:[image size]]; | 1589 [incognitoBadge_ setFrameSize:[image size]]; |
1590 [incognitoBadge_ setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin]; | 1590 [incognitoBadge_ setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin]; |
1591 [incognitoBadge_ setHidden:YES]; | 1591 [incognitoBadge_ setHidden:YES]; |
1592 | 1592 |
1593 // Install the view. | 1593 // Install the view. |
1594 [[[[self window] contentView] superview] addSubview:incognitoBadge_]; | 1594 [[[[self window] contentView] superview] addSubview:incognitoBadge_]; |
1595 } | 1595 } |
1596 | 1596 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 | 2079 |
2080 - (BOOL)supportsBookmarkBar { | 2080 - (BOOL)supportsBookmarkBar { |
2081 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2081 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2082 } | 2082 } |
2083 | 2083 |
2084 - (BOOL)isNormalWindow { | 2084 - (BOOL)isNormalWindow { |
2085 return browser_->type() == Browser::TYPE_NORMAL; | 2085 return browser_->type() == Browser::TYPE_NORMAL; |
2086 } | 2086 } |
2087 | 2087 |
2088 @end // @implementation BrowserWindowController(WindowType) | 2088 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |