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 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 3960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3971 window_->SetStarredState( | 3971 window_->SetStarredState( |
3972 current_tab_wrapper->bookmark_tab_helper()->is_starred()); | 3972 current_tab_wrapper->bookmark_tab_helper()->is_starred()); |
3973 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, | 3973 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, |
3974 current_tab->controller().CanViewSource()); | 3974 current_tab->controller().CanViewSource()); |
3975 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, | 3975 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, |
3976 current_tab->ShouldDisplayURL() && current_tab->GetURL().is_valid()); | 3976 current_tab->ShouldDisplayURL() && current_tab->GetURL().is_valid()); |
3977 if (is_devtools()) | 3977 if (is_devtools()) |
3978 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); | 3978 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); |
3979 | 3979 |
3980 // Changing the encoding is not possible on Chrome-internal webpages. | 3980 // Changing the encoding is not possible on Chrome-internal webpages. |
3981 // Instead of using GetURL here, we use url() (which is the "real" url of the | 3981 // Instead of using GetURL here, we use url() (which is the "real" url of the |
Peter Kasting
2011/07/04 22:36:02
This comment is now out-of-date, no?
Alexei Svitkine (slow)
2011/07/05 14:18:13
You're right - I removed the out of date comment.
| |
3982 // page) from the NavigationEntry because its reflects their origin rather | 3982 // page) from the NavigationEntry because its reflects their origin rather |
3983 // than the display one (returned by GetURL) which may be different (like | 3983 // than the display one (returned by GetURL) which may be different (like |
3984 // having "view-source:" on the front). | 3984 // having "view-source:" on the front). |
3985 NavigationEntry* active_entry = nc.GetActiveEntry(); | 3985 NavigationEntry* active_entry = nc.GetActiveEntry(); |
3986 bool is_chrome_internal = (active_entry ? | 3986 bool is_chrome_internal = (active_entry ? |
3987 active_entry->url().SchemeIs(chrome::kChromeUIScheme) : false); | 3987 active_entry->virtual_url().SchemeIs(chrome::kChromeUIScheme) : false); |
3988 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, | 3988 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, |
3989 !is_chrome_internal && SavePackage::IsSavableContents( | 3989 !is_chrome_internal && SavePackage::IsSavableContents( |
3990 current_tab->contents_mime_type())); | 3990 current_tab->contents_mime_type())); |
3991 | 3991 |
3992 // Show various bits of UI | 3992 // Show various bits of UI |
3993 // TODO(pinkerton): Disable app-mode in the model until we implement it | 3993 // TODO(pinkerton): Disable app-mode in the model until we implement it |
3994 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 | 3994 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 |
3995 #if !defined(OS_MACOSX) | 3995 #if !defined(OS_MACOSX) |
3996 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, | 3996 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, |
3997 web_app::IsValidUrl(current_tab->GetURL())); | 3997 web_app::IsValidUrl(current_tab->GetURL())); |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4721 // end up querying state once they process the tab switch. | 4721 // end up querying state once they process the tab switch. |
4722 return; | 4722 return; |
4723 } | 4723 } |
4724 | 4724 |
4725 BookmarkBar::AnimateChangeType animate_type = | 4725 BookmarkBar::AnimateChangeType animate_type = |
4726 (reason == BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE) ? | 4726 (reason == BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE) ? |
4727 BookmarkBar::ANIMATE_STATE_CHANGE : | 4727 BookmarkBar::ANIMATE_STATE_CHANGE : |
4728 BookmarkBar::DONT_ANIMATE_STATE_CHANGE; | 4728 BookmarkBar::DONT_ANIMATE_STATE_CHANGE; |
4729 window_->BookmarkBarStateChanged(animate_type); | 4729 window_->BookmarkBarStateChanged(animate_type); |
4730 } | 4730 } |
OLD | NEW |