Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 7309006: Disable encoding menu item for chrome://bookmarks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698