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

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

Issue 22882007: Remove GetActiveEntry usage from chrome/browser/ui. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT. Created 7 years, 2 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 | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_command_controller.h" 5 #include "chrome/browser/ui/browser_command_controller.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 window()->ZoomChangedForActiveTab(false); 1029 window()->ZoomChangedForActiveTab(false);
1030 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, 1030 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE,
1031 CanViewSource(browser_)); 1031 CanViewSource(browser_));
1032 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, 1032 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION,
1033 CanEmailPageLocation(browser_)); 1033 CanEmailPageLocation(browser_));
1034 if (browser_->is_devtools()) 1034 if (browser_->is_devtools())
1035 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); 1035 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false);
1036 1036
1037 // Changing the encoding is not possible on Chrome-internal webpages. 1037 // Changing the encoding is not possible on Chrome-internal webpages.
1038 NavigationController& nc = current_web_contents->GetController(); 1038 NavigationController& nc = current_web_contents->GetController();
1039 bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) || 1039 bool is_chrome_internal = HasInternalURL(nc.GetVisibleEntry()) ||
1040 current_web_contents->ShowingInterstitialPage(); 1040 current_web_contents->ShowingInterstitialPage();
1041 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, 1041 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU,
1042 !is_chrome_internal && current_web_contents->IsSavable()); 1042 !is_chrome_internal && current_web_contents->IsSavable());
1043 1043
1044 // Show various bits of UI 1044 // Show various bits of UI
1045 // TODO(pinkerton): Disable app-mode in the model until we implement it 1045 // TODO(pinkerton): Disable app-mode in the model until we implement it
1046 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 1046 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148
1047 #if !defined(OS_MACOSX) 1047 #if !defined(OS_MACOSX)
1048 command_updater_.UpdateCommandEnabled( 1048 command_updater_.UpdateCommandEnabled(
1049 IDC_CREATE_SHORTCUTS, 1049 IDC_CREATE_SHORTCUTS,
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 1273
1274 BrowserWindow* BrowserCommandController::window() { 1274 BrowserWindow* BrowserCommandController::window() {
1275 return browser_->window(); 1275 return browser_->window();
1276 } 1276 }
1277 1277
1278 Profile* BrowserCommandController::profile() { 1278 Profile* BrowserCommandController::profile() {
1279 return browser_->profile(); 1279 return browser_->profile();
1280 } 1280 }
1281 1281
1282 } // namespace chrome 1282 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698