OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" | 11 #include "app/mac/scoped_nsdisable_screen_updates.h" |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 if (tag == IDC_SHOW_BOOKMARK_BAR) { | 899 if (tag == IDC_SHOW_BOOKMARK_BAR) { |
900 bool toggled = windowShim_->IsBookmarkBarVisible(); | 900 bool toggled = windowShim_->IsBookmarkBarVisible(); |
901 NSInteger oldState = [item state]; | 901 NSInteger oldState = [item state]; |
902 NSInteger newState = toggled ? NSOnState : NSOffState; | 902 NSInteger newState = toggled ? NSOnState : NSOffState; |
903 if (oldState != newState) | 903 if (oldState != newState) |
904 [item setState:newState]; | 904 [item setState:newState]; |
905 } | 905 } |
906 | 906 |
907 // Update the checked/Unchecked state of items in the encoding menu. | 907 // Update the checked/Unchecked state of items in the encoding menu. |
908 // On Windows, this logic is part of |EncodingMenuModel| in | 908 // On Windows, this logic is part of |EncodingMenuModel| in |
909 // browser/views/toolbar_view.h. | 909 // browser/ui/views/toolbar_view.h. |
910 EncodingMenuController encoding_controller; | 910 EncodingMenuController encoding_controller; |
911 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { | 911 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { |
912 DCHECK(browser_.get()); | 912 DCHECK(browser_.get()); |
913 Profile* profile = browser_->profile(); | 913 Profile* profile = browser_->profile(); |
914 DCHECK(profile); | 914 DCHECK(profile); |
915 TabContents* current_tab = browser_->GetSelectedTabContents(); | 915 TabContents* current_tab = browser_->GetSelectedTabContents(); |
916 if (!current_tab) { | 916 if (!current_tab) { |
917 return; | 917 return; |
918 } | 918 } |
919 const std::string encoding = current_tab->encoding(); | 919 const std::string encoding = current_tab->encoding(); |
(...skipping 1159 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 |