Chromium Code Reviews| 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 6200059dccd5d8e387388f2b884c6b877a9e6f0f..0a740c3cae693a957067a6b24fa4bd747a257d9b 100644 |
| --- a/chrome/browser/ui/views/toolbar/app_menu.cc |
| +++ b/chrome/browser/ui/views/toolbar/app_menu.cc |
| @@ -647,17 +647,19 @@ class AppMenu::ZoomView : public AppMenuView { |
| } |
| } |
| - // Overridden from AppMenuObserver. |
| - void AppMenuDestroyed() override { AppMenuView::AppMenuDestroyed(); } |
|
Devlin
2016/03/15 21:39:22
Drive-by: this was a bit silly.
|
| - |
| private: |
| + content::WebContents* GetActiveWebContents() const { |
| + return menu() ? |
| + menu()->browser_->tab_strip_model()->GetActiveWebContents() : |
| + nullptr; |
| + } |
| + |
| void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change) { |
| UpdateZoomControls(); |
| } |
| void UpdateZoomControls() { |
| - WebContents* selected_tab = |
| - menu()->browser_->tab_strip_model()->GetActiveWebContents(); |
| + WebContents* selected_tab = GetActiveWebContents(); |
| int zoom = 100; |
| if (selected_tab) { |
| auto zoom_controller = |
| @@ -685,8 +687,7 @@ class AppMenu::ZoomView : public AppMenuView { |
| int max_w = 0; |
| - WebContents* selected_tab = |
| - menu()->browser_->tab_strip_model()->GetActiveWebContents(); |
| + WebContents* selected_tab = GetActiveWebContents(); |
| if (selected_tab) { |
| auto zoom_controller = |
| ui_zoom::ZoomController::FromWebContents(selected_tab); |