| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "app/animation.h" | 10 #include "app/animation.h" |
| (...skipping 2762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2773 | 2773 |
| 2774 // Window management commands | 2774 // Window management commands |
| 2775 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, | 2775 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, |
| 2776 !(type() & TYPE_APP) && CanDuplicateContentsAt(selected_index())); | 2776 !(type() & TYPE_APP) && CanDuplicateContentsAt(selected_index())); |
| 2777 command_updater_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, | 2777 command_updater_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, |
| 2778 !(type() & TYPE_APP) && tab_count() > 1); | 2778 !(type() & TYPE_APP) && tab_count() > 1); |
| 2779 command_updater_.UpdateCommandEnabled(IDC_SELECT_PREVIOUS_TAB, | 2779 command_updater_.UpdateCommandEnabled(IDC_SELECT_PREVIOUS_TAB, |
| 2780 !(type() & TYPE_APP) && tab_count() > 1); | 2780 !(type() & TYPE_APP) && tab_count() > 1); |
| 2781 | 2781 |
| 2782 // Current navigation entry, may be NULL. | 2782 // Current navigation entry, may be NULL. |
| 2783 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 2783 NavigationEntry* active_entry = nc.GetActiveEntry(); |
| 2784 | 2784 |
| 2785 // Page-related commands | 2785 // Page-related commands |
| 2786 window_->SetStarredState(current_tab->is_starred()); | 2786 window_->SetStarredState(current_tab->is_starred()); |
| 2787 command_updater_.UpdateCommandEnabled(IDC_BOOKMARK_ALL_TABS, | 2787 command_updater_.UpdateCommandEnabled(IDC_BOOKMARK_ALL_TABS, |
| 2788 CanBookmarkAllTabs()); | 2788 CanBookmarkAllTabs()); |
| 2789 | 2789 |
| 2790 // View-source should not be enabled if already in view-source mode or | 2790 // View-source should not be enabled if already in view-source mode or |
| 2791 // the source is not viewable. | 2791 // the source is not viewable. |
| 2792 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, | 2792 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, |
| 2793 current_tab->controller().CanViewSource()); | 2793 current_tab->controller().CanViewSource()); |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3402 return; | 3402 return; |
| 3403 | 3403 |
| 3404 ExtensionsService* extension_service = profile()->GetExtensionsService(); | 3404 ExtensionsService* extension_service = profile()->GetExtensionsService(); |
| 3405 if (extension_service && extension_service->is_ready()) { | 3405 if (extension_service && extension_service->is_ready()) { |
| 3406 Extension* extension = | 3406 Extension* extension = |
| 3407 extension_service->GetExtensionById(app_extension_id, false); | 3407 extension_service->GetExtensionById(app_extension_id, false); |
| 3408 if (extension) | 3408 if (extension) |
| 3409 contents->SetAppExtension(extension); | 3409 contents->SetAppExtension(extension); |
| 3410 } | 3410 } |
| 3411 } | 3411 } |
| OLD | NEW |