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 #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/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2473 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_3, true); | 2473 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_3, true); |
2474 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_4, true); | 2474 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_4, true); |
2475 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_5, true); | 2475 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_5, true); |
2476 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_6, true); | 2476 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_6, true); |
2477 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_7, true); | 2477 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_7, true); |
2478 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_8, true); | 2478 command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW_PROFILE_8, true); |
2479 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); | 2479 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); |
2480 command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true); | 2480 command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true); |
2481 command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true); | 2481 command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true); |
2482 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true); | 2482 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true); |
2483 // TODO(viettrungluu): Temporarily disabled on Mac. Must disable here (not in | |
2484 // BWC) so that it also affects the wrench menu. http://crbug.com/31638 | |
2485 #if !defined(OS_MACOSX) | |
2483 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, true); | 2486 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, true); |
Nico
2010/01/08 23:08:04
shouldn't this be "false"? also below.
(If not, t
viettrungluu
2010/01/08 23:09:58
It's an #ifndef. Commands are disabled by default.
Nico
2010/01/08 23:11:22
doh. Carry on.
| |
2487 #endif | |
2484 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); | 2488 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); |
2485 #if defined(TOOLKIT_VIEWS) | 2489 #if defined(TOOLKIT_VIEWS) |
2486 command_updater_.UpdateCommandEnabled(IDC_COMPACT_NAVBAR, true); | 2490 command_updater_.UpdateCommandEnabled(IDC_COMPACT_NAVBAR, true); |
2487 #endif | 2491 #endif |
2488 | 2492 |
2489 // Page-related commands | 2493 // Page-related commands |
2490 command_updater_.UpdateCommandEnabled(IDC_CLOSE_POPUPS, true); | 2494 command_updater_.UpdateCommandEnabled(IDC_CLOSE_POPUPS, true); |
2491 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); | 2495 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); |
2492 command_updater_.UpdateCommandEnabled(IDC_PRINT, true); | 2496 command_updater_.UpdateCommandEnabled(IDC_PRINT, true); |
2493 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); | 2497 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2544 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MENU, true); | 2548 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MENU, true); |
2545 command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS, true); | 2549 command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS, true); |
2546 command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, true); | 2550 command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, true); |
2547 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS, true); | 2551 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS, true); |
2548 | 2552 |
2549 // Show various bits of UI | 2553 // Show various bits of UI |
2550 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, true); | 2554 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, true); |
2551 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); | 2555 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); |
2552 command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS, true); | 2556 command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS, true); |
2553 command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS_CONSOLE, true); | 2557 command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS_CONSOLE, true); |
2558 // TODO(viettrungluu): Temporarily disabled on Mac. Must disable here (not in | |
2559 // BWC) so that it also affects the page menu. http://crbug.com/13156 | |
2560 #if !defined(OS_MACOSX) | |
2554 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true); | 2561 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true); |
2562 #endif | |
2555 command_updater_.UpdateCommandEnabled(IDC_SELECT_PROFILE, true); | 2563 command_updater_.UpdateCommandEnabled(IDC_SELECT_PROFILE, true); |
2556 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true); | 2564 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true); |
2557 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true); | 2565 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true); |
2558 command_updater_.UpdateCommandEnabled(IDC_SHOW_EXTENSION_SHELF, true); | 2566 command_updater_.UpdateCommandEnabled(IDC_SHOW_EXTENSION_SHELF, true); |
2559 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); | 2567 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); |
2560 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE, true); | 2568 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE, true); |
2561 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true); | 2569 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true); |
2562 | 2570 |
2563 ExtensionsService* extensions_service = profile()->GetExtensionsService(); | 2571 ExtensionsService* extensions_service = profile()->GetExtensionsService(); |
2564 bool enable_extensions = | 2572 bool enable_extensions = |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3188 /////////////////////////////////////////////////////////////////////////////// | 3196 /////////////////////////////////////////////////////////////////////////////// |
3189 // BrowserToolbarModel (private): | 3197 // BrowserToolbarModel (private): |
3190 | 3198 |
3191 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 3199 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
3192 // This |current_tab| can be NULL during the initialization of the | 3200 // This |current_tab| can be NULL during the initialization of the |
3193 // toolbar during window creation (i.e. before any tabs have been added | 3201 // toolbar during window creation (i.e. before any tabs have been added |
3194 // to the window). | 3202 // to the window). |
3195 TabContents* current_tab = browser_->GetSelectedTabContents(); | 3203 TabContents* current_tab = browser_->GetSelectedTabContents(); |
3196 return current_tab ? ¤t_tab->controller() : NULL; | 3204 return current_tab ? ¤t_tab->controller() : NULL; |
3197 } | 3205 } |
OLD | NEW |