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

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

Issue 10736028: Refactor browser window zoom handling and enable zoom icon on all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
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.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 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 // Browser, BookmarkTabHelperDelegate implementation: 1990 // Browser, BookmarkTabHelperDelegate implementation:
1991 1991
1992 void Browser::URLStarredChanged(TabContents* source, bool starred) { 1992 void Browser::URLStarredChanged(TabContents* source, bool starred) {
1993 if (source == chrome::GetActiveTabContents(this)) 1993 if (source == chrome::GetActiveTabContents(this))
1994 window_->SetStarredState(starred); 1994 window_->SetStarredState(starred);
1995 } 1995 }
1996 1996
1997 /////////////////////////////////////////////////////////////////////////////// 1997 ///////////////////////////////////////////////////////////////////////////////
1998 // Browser, ZoomObserver implementation: 1998 // Browser, ZoomObserver implementation:
1999 1999
2000 void Browser::OnZoomIconChanged(TabContents* source, 2000 void Browser::OnZoomChanged(TabContents* source, bool can_show_bubble) {
2001 ZoomController::ZoomIconState state) { 2001 // Only show the zoom bubble for zoom changes in the active window.
2002 if (source == chrome::GetActiveTabContents(this)) 2002 if (source == chrome::GetActiveTabContents(this) && window_->IsActive())
2003 window_->SetZoomIconState(state); 2003 window_->ZoomChangedForActiveTab(can_show_bubble);
2004 }
2005
2006 void Browser::OnZoomChanged(TabContents* source,
2007 int zoom_percent,
2008 bool can_show_bubble) {
2009 if (source == chrome::GetActiveTabContents(this)) {
2010 window_->SetZoomIconTooltipPercent(zoom_percent);
2011
2012 // Only show the zoom bubble for zoom changes in the active window.
2013 if (can_show_bubble && window_->IsActive())
2014 window_->ShowZoomBubble(zoom_percent);
2015 }
2016 } 2004 }
2017 2005
2018 /////////////////////////////////////////////////////////////////////////////// 2006 ///////////////////////////////////////////////////////////////////////////////
2019 // Browser, SelectFileDialog::Listener implementation: 2007 // Browser, SelectFileDialog::Listener implementation:
2020 2008
2021 void Browser::FileSelected(const FilePath& path, int index, void* params) { 2009 void Browser::FileSelected(const FilePath& path, int index, void* params) {
2022 profile_->set_last_selected_directory(path.DirName()); 2010 profile_->set_last_selected_directory(path.DirName());
2023 GURL file_url = net::FilePathToFileURL(path); 2011 GURL file_url = net::FilePathToFileURL(path);
2024 2012
2025 #if defined(OS_CHROMEOS) 2013 #if defined(OS_CHROMEOS)
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 if (contents && !allow_js_access) { 2719 if (contents && !allow_js_access) {
2732 contents->web_contents()->GetController().LoadURL( 2720 contents->web_contents()->GetController().LoadURL(
2733 target_url, 2721 target_url,
2734 content::Referrer(), 2722 content::Referrer(),
2735 content::PAGE_TRANSITION_LINK, 2723 content::PAGE_TRANSITION_LINK,
2736 std::string()); // No extra headers. 2724 std::string()); // No extra headers.
2737 } 2725 }
2738 2726
2739 return contents != NULL; 2727 return contents != NULL;
2740 } 2728 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698