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

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

Issue 310913002: Issue 32919: Update the Zoom NSMenuItems (Zoom-In/Zoom-out/Actual-Size) when the zoom state changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified zoom_controller_unittests to pass try jobs on bots. Created 6 years, 4 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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.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 // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 1839
1840 /////////////////////////////////////////////////////////////////////////////// 1840 ///////////////////////////////////////////////////////////////////////////////
1841 // Browser, ZoomObserver implementation: 1841 // Browser, ZoomObserver implementation:
1842 1842
1843 void Browser::OnZoomChanged(content::WebContents* source, 1843 void Browser::OnZoomChanged(content::WebContents* source,
1844 bool can_show_bubble) { 1844 bool can_show_bubble) {
1845 if (source == tab_strip_model_->GetActiveWebContents()) { 1845 if (source == tab_strip_model_->GetActiveWebContents()) {
1846 // Only show the zoom bubble for zoom changes in the active window. 1846 // Only show the zoom bubble for zoom changes in the active window.
1847 window_->ZoomChangedForActiveTab(can_show_bubble && window_->IsActive() && 1847 window_->ZoomChangedForActiveTab(can_show_bubble && window_->IsActive() &&
1848 !is_devtools()); 1848 !is_devtools());
1849 // Change the zoom commands state based on the zoom state
1850 command_controller_->ZoomStateChanged();
1849 } 1851 }
1850 } 1852 }
1851 1853
1852 /////////////////////////////////////////////////////////////////////////////// 1854 ///////////////////////////////////////////////////////////////////////////////
1853 // Browser, ui::SelectFileDialog::Listener implementation: 1855 // Browser, ui::SelectFileDialog::Listener implementation:
1854 1856
1855 void Browser::FileSelected(const base::FilePath& path, int index, 1857 void Browser::FileSelected(const base::FilePath& path, int index,
1856 void* params) { 1858 void* params) {
1857 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params); 1859 FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params);
1858 } 1860 }
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 if (contents && !allow_js_access) { 2419 if (contents && !allow_js_access) {
2418 contents->web_contents()->GetController().LoadURL( 2420 contents->web_contents()->GetController().LoadURL(
2419 target_url, 2421 target_url,
2420 content::Referrer(), 2422 content::Referrer(),
2421 content::PAGE_TRANSITION_LINK, 2423 content::PAGE_TRANSITION_LINK,
2422 std::string()); // No extra headers. 2424 std::string()); // No extra headers.
2423 } 2425 }
2424 2426
2425 return contents != NULL; 2427 return contents != NULL;
2426 } 2428 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698