| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 "chrome/browser/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #include "app/animation.h" | 7 #include "app/animation.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/idle_timer.h" | 10 #include "base/idle_timer.h" |
| (...skipping 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2257 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_8, true); | 2257 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_8, true); |
| 2258 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); | 2258 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); |
| 2259 command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true); | 2259 command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true); |
| 2260 command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true); | 2260 command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true); |
| 2261 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true); | 2261 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true); |
| 2262 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, true); | 2262 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, true); |
| 2263 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); | 2263 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); |
| 2264 | 2264 |
| 2265 // Page-related commands | 2265 // Page-related commands |
| 2266 command_updater_.UpdateCommandEnabled(IDC_CLOSE_POPUPS, true); | 2266 command_updater_.UpdateCommandEnabled(IDC_CLOSE_POPUPS, true); |
| 2267 // TODO(estade): remove these ifdefs when printing is fully supported. | |
| 2268 #if defined(OS_LINUX) | |
| 2269 #if defined(TOOLKIT_GTK) | |
| 2270 command_updater_.UpdateCommandEnabled(IDC_PRINT, | |
| 2271 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePrinting)); | |
| 2272 #elif defined(TOOLKIT_VIEWS) | |
| 2273 command_updater_.UpdateCommandEnabled(IDC_PRINT, false); | |
| 2274 #endif | |
| 2275 #else // !defined(OS_LINUX) | |
| 2276 command_updater_.UpdateCommandEnabled(IDC_PRINT, true); | 2267 command_updater_.UpdateCommandEnabled(IDC_PRINT, true); |
| 2277 #endif | |
| 2278 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); | 2268 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); |
| 2279 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); | 2269 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); |
| 2280 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); | 2270 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); |
| 2281 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); | 2271 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); |
| 2282 command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true); | 2272 command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true); |
| 2283 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true); | 2273 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true); |
| 2284 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GB18030, true); | 2274 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GB18030, true); |
| 2285 command_updater_.UpdateCommandEnabled(IDC_ENCODING_BIG5HKSCS, true); | 2275 command_updater_.UpdateCommandEnabled(IDC_ENCODING_BIG5HKSCS, true); |
| 2286 command_updater_.UpdateCommandEnabled(IDC_ENCODING_BIG5, true); | 2276 command_updater_.UpdateCommandEnabled(IDC_ENCODING_BIG5, true); |
| 2287 command_updater_.UpdateCommandEnabled(IDC_ENCODING_THAI, true); | 2277 command_updater_.UpdateCommandEnabled(IDC_ENCODING_THAI, true); |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2937 /////////////////////////////////////////////////////////////////////////////// | 2927 /////////////////////////////////////////////////////////////////////////////// |
| 2938 // BrowserToolbarModel (private): | 2928 // BrowserToolbarModel (private): |
| 2939 | 2929 |
| 2940 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2930 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2941 // This |current_tab| can be NULL during the initialization of the | 2931 // This |current_tab| can be NULL during the initialization of the |
| 2942 // toolbar during window creation (i.e. before any tabs have been added | 2932 // toolbar during window creation (i.e. before any tabs have been added |
| 2943 // to the window). | 2933 // to the window). |
| 2944 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2934 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2945 return current_tab ? ¤t_tab->controller() : NULL; | 2935 return current_tab ? ¤t_tab->controller() : NULL; |
| 2946 } | 2936 } |
| OLD | NEW |