| OLD | NEW |
| 1 // Copyright (c) 2011 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 <cmath> | 7 #include <cmath> |
| 8 #include <numeric> | 8 #include <numeric> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 // browser/ui/views/toolbar_view.h. | 954 // browser/ui/views/toolbar_view.h. |
| 955 EncodingMenuController encoding_controller; | 955 EncodingMenuController encoding_controller; |
| 956 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { | 956 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { |
| 957 DCHECK(browser_.get()); | 957 DCHECK(browser_.get()); |
| 958 Profile* profile = browser_->profile(); | 958 Profile* profile = browser_->profile(); |
| 959 DCHECK(profile); | 959 DCHECK(profile); |
| 960 TabContents* current_tab = browser_->GetSelectedTabContents(); | 960 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 961 if (!current_tab) { | 961 if (!current_tab) { |
| 962 return; | 962 return; |
| 963 } | 963 } |
| 964 const std::string encoding = current_tab->encoding(); | 964 const std::string encoding = current_tab->GetEncoding(); |
| 965 | 965 |
| 966 bool toggled = encoding_controller.IsItemChecked(profile, encoding, tag); | 966 bool toggled = encoding_controller.IsItemChecked(profile, encoding, tag); |
| 967 NSInteger oldState = [item state]; | 967 NSInteger oldState = [item state]; |
| 968 NSInteger newState = toggled ? NSOnState : NSOffState; | 968 NSInteger newState = toggled ? NSOnState : NSOffState; |
| 969 if (oldState != newState) | 969 if (oldState != newState) |
| 970 [item setState:newState]; | 970 [item setState:newState]; |
| 971 } | 971 } |
| 972 } | 972 } |
| 973 | 973 |
| 974 - (BOOL)supportsFullscreen { | 974 - (BOOL)supportsFullscreen { |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2177 | 2177 |
| 2178 - (BOOL)supportsBookmarkBar { | 2178 - (BOOL)supportsBookmarkBar { |
| 2179 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2179 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2180 } | 2180 } |
| 2181 | 2181 |
| 2182 - (BOOL)isTabbedWindow { | 2182 - (BOOL)isTabbedWindow { |
| 2183 return browser_->is_type_tabbed(); | 2183 return browser_->is_type_tabbed(); |
| 2184 } | 2184 } |
| 2185 | 2185 |
| 2186 @end // @implementation BrowserWindowController(WindowType) | 2186 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |