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

Unified Diff: chrome/browser/ui/views/toolbar/app_menu.cc

Issue 1877373003: Disable zoom-in and zoom-out buttons in toolbar menu for a crashed page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/app_menu.cc
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc
index 8abd0fa5d0393eff077e9687244a1abe7cb665c0..3e892acc3d5bb60f1ecf242d32f072884e0cdcc8 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/toolbar/app_menu_model.h"
@@ -630,17 +631,17 @@ class AppMenu::ZoomView : public AppMenuView {
}
void UpdateZoomControls() {
- WebContents* selected_tab = GetActiveWebContents();
+ WebContents* contents = GetActiveWebContents();
int zoom = 100;
- if (selected_tab) {
+ if (contents) {
auto zoom_controller =
- ui_zoom::ZoomController::FromWebContents(selected_tab);
+ ui_zoom::ZoomController::FromWebContents(contents);
if (zoom_controller)
zoom = zoom_controller->GetZoomPercent();
increment_button_->SetEnabled(zoom <
- selected_tab->GetMaximumZoomPercent());
+ contents->GetMaximumZoomPercent());
decrement_button_->SetEnabled(zoom >
- selected_tab->GetMinimumZoomPercent());
+ contents->GetMinimumZoomPercent());
}
zoom_label_->SetText(base::FormatPercent(zoom));
zoom_label_max_width_valid_ = false;
« no previous file with comments | « chrome/browser/ui/browser_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698