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

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

Issue 954923005: Make command-zero reset page scale in addition to zoom level (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again again Created 5 years, 9 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_commands.h" 5 #include "chrome/browser/ui/browser_commands.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 return zoom_controller->GetZoomPercent() != contents->GetMaximumZoomPercent(); 571 return zoom_controller->GetZoomPercent() != contents->GetMaximumZoomPercent();
572 } 572 }
573 573
574 bool CanZoomOut(content::WebContents* contents) { 574 bool CanZoomOut(content::WebContents* contents) {
575 ui_zoom::ZoomController* zoom_controller = 575 ui_zoom::ZoomController* zoom_controller =
576 ui_zoom::ZoomController::FromWebContents(contents); 576 ui_zoom::ZoomController::FromWebContents(contents);
577 return zoom_controller->GetZoomPercent() != 577 return zoom_controller->GetZoomPercent() !=
578 contents->GetMinimumZoomPercent(); 578 contents->GetMinimumZoomPercent();
579 } 579 }
580 580
581 bool IsAtDefaultZoom(content::WebContents* contents) { 581 bool CanResetZoom(content::WebContents* contents) {
582 ui_zoom::ZoomController* zoom_controller = 582 ui_zoom::ZoomController* zoom_controller =
583 ui_zoom::ZoomController::FromWebContents(contents); 583 ui_zoom::ZoomController::FromWebContents(contents);
584 return zoom_controller->IsAtDefaultZoom(); 584 return !zoom_controller->IsAtDefaultZoom() ||
585 !zoom_controller->PageScaleFactorIsOne();
585 } 586 }
586 587
587 TabStripModelDelegate::RestoreTabType GetRestoreTabType( 588 TabStripModelDelegate::RestoreTabType GetRestoreTabType(
588 const Browser* browser) { 589 const Browser* browser) {
589 TabRestoreService* service = 590 TabRestoreService* service =
590 TabRestoreServiceFactory::GetForProfile(browser->profile()); 591 TabRestoreServiceFactory::GetForProfile(browser->profile());
591 if (!service || service->entries().empty()) 592 if (!service || service->entries().empty())
592 return TabStripModelDelegate::RESTORE_NONE; 593 return TabStripModelDelegate::RESTORE_NONE;
593 if (service->entries().front()->type == TabRestoreService::WINDOW) 594 if (service->entries().front()->type == TabRestoreService::WINDOW)
594 return TabStripModelDelegate::RESTORE_WINDOW; 595 return TabStripModelDelegate::RESTORE_WINDOW;
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 browser->host_desktop_type())); 1277 browser->host_desktop_type()));
1277 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1278 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1278 1279
1279 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1280 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1280 contents->GetRenderViewHost()->SyncRendererPrefs(); 1281 contents->GetRenderViewHost()->SyncRendererPrefs();
1281 app_browser->window()->Show(); 1282 app_browser->window()->Show();
1282 } 1283 }
1283 #endif // defined(ENABLE_EXTENSIONS) 1284 #endif // defined(ENABLE_EXTENSIONS)
1284 1285
1285 } // namespace chrome 1286 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/webui/options/content_settings_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698