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

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

Issue 2019423005: Move //components/ui/zoom to top-level under //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/browser_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include "components/bookmarks/browser/bookmark_model.h" 57 #include "components/bookmarks/browser/bookmark_model.h"
58 #include "components/bookmarks/browser/bookmark_utils.h" 58 #include "components/bookmarks/browser/bookmark_utils.h"
59 #include "components/bookmarks/common/bookmark_pref_names.h" 59 #include "components/bookmarks/common/bookmark_pref_names.h"
60 #include "components/favicon/content/content_favicon_driver.h" 60 #include "components/favicon/content/content_favicon_driver.h"
61 #include "components/google/core/browser/google_util.h" 61 #include "components/google/core/browser/google_util.h"
62 #include "components/prefs/pref_service.h" 62 #include "components/prefs/pref_service.h"
63 #include "components/sessions/core/live_tab_context.h" 63 #include "components/sessions/core/live_tab_context.h"
64 #include "components/sessions/core/tab_restore_service.h" 64 #include "components/sessions/core/tab_restore_service.h"
65 #include "components/signin/core/browser/signin_header_helper.h" 65 #include "components/signin/core/browser/signin_header_helper.h"
66 #include "components/translate/core/browser/language_state.h" 66 #include "components/translate/core/browser/language_state.h"
67 #include "components/ui/zoom/page_zoom.h"
68 #include "components/ui/zoom/zoom_controller.h"
69 #include "components/version_info/version_info.h" 67 #include "components/version_info/version_info.h"
70 #include "components/web_modal/web_contents_modal_dialog_manager.h" 68 #include "components/web_modal/web_contents_modal_dialog_manager.h"
69 #include "components/zoom/page_zoom.h"
70 #include "components/zoom/zoom_controller.h"
71 #include "content/public/browser/devtools_agent_host.h" 71 #include "content/public/browser/devtools_agent_host.h"
72 #include "content/public/browser/navigation_controller.h" 72 #include "content/public/browser/navigation_controller.h"
73 #include "content/public/browser/navigation_entry.h" 73 #include "content/public/browser/navigation_entry.h"
74 #include "content/public/browser/notification_service.h" 74 #include "content/public/browser/notification_service.h"
75 #include "content/public/browser/page_navigator.h" 75 #include "content/public/browser/page_navigator.h"
76 #include "content/public/browser/render_view_host.h" 76 #include "content/public/browser/render_view_host.h"
77 #include "content/public/browser/render_widget_host_view.h" 77 #include "content/public/browser/render_widget_host_view.h"
78 #include "content/public/browser/user_metrics.h" 78 #include "content/public/browser/user_metrics.h"
79 #include "content/public/browser/web_contents.h" 79 #include "content/public/browser/web_contents.h"
80 #include "content/public/common/page_state.h" 80 #include "content/public/common/page_state.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 } 573 }
574 } 574 }
575 575
576 void CloseTab(Browser* browser) { 576 void CloseTab(Browser* browser) {
577 content::RecordAction(UserMetricsAction("CloseTab_Accelerator")); 577 content::RecordAction(UserMetricsAction("CloseTab_Accelerator"));
578 browser->tab_strip_model()->CloseSelectedTabs(); 578 browser->tab_strip_model()->CloseSelectedTabs();
579 } 579 }
580 580
581 bool CanZoomIn(content::WebContents* contents) { 581 bool CanZoomIn(content::WebContents* contents) {
582 return contents && !contents->IsCrashed() && 582 return contents && !contents->IsCrashed() &&
583 ui_zoom::ZoomController::FromWebContents(contents)->GetZoomPercent() != 583 zoom::ZoomController::FromWebContents(contents)->GetZoomPercent() !=
584 contents->GetMaximumZoomPercent(); 584 contents->GetMaximumZoomPercent();
585 } 585 }
586 586
587 bool CanZoomOut(content::WebContents* contents) { 587 bool CanZoomOut(content::WebContents* contents) {
588 return contents && !contents->IsCrashed() && 588 return contents && !contents->IsCrashed() &&
589 ui_zoom::ZoomController::FromWebContents(contents)->GetZoomPercent() != 589 zoom::ZoomController::FromWebContents(contents)->GetZoomPercent() !=
590 contents->GetMinimumZoomPercent(); 590 contents->GetMinimumZoomPercent();
591 } 591 }
592 592
593 bool CanResetZoom(content::WebContents* contents) { 593 bool CanResetZoom(content::WebContents* contents) {
594 ui_zoom::ZoomController* zoom_controller = 594 zoom::ZoomController* zoom_controller =
595 ui_zoom::ZoomController::FromWebContents(contents); 595 zoom::ZoomController::FromWebContents(contents);
596 return !zoom_controller->IsAtDefaultZoom() || 596 return !zoom_controller->IsAtDefaultZoom() ||
597 !zoom_controller->PageScaleFactorIsOne(); 597 !zoom_controller->PageScaleFactorIsOne();
598 } 598 }
599 599
600 TabStripModelDelegate::RestoreTabType GetRestoreTabType( 600 TabStripModelDelegate::RestoreTabType GetRestoreTabType(
601 const Browser* browser) { 601 const Browser* browser) {
602 sessions::TabRestoreService* service = 602 sessions::TabRestoreService* service =
603 TabRestoreServiceFactory::GetForProfile(browser->profile()); 603 TabRestoreServiceFactory::GetForProfile(browser->profile());
604 if (!service || service->entries().empty()) 604 if (!service || service->entries().empty())
605 return TabStripModelDelegate::RESTORE_NONE; 605 return TabStripModelDelegate::RESTORE_NONE;
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 // Incognito window it's the newest value of the find pboard content and 982 // Incognito window it's the newest value of the find pboard content and
983 // user-typed text. 983 // user-typed text.
984 FindBar* find_bar = browser->GetFindBarController()->find_bar(); 984 FindBar* find_bar = browser->GetFindBarController()->find_bar();
985 find_text = find_bar->GetFindText(); 985 find_text = find_bar->GetFindText();
986 #endif 986 #endif
987 find_helper->StartFinding(find_text, forward_direction, false); 987 find_helper->StartFinding(find_text, forward_direction, false);
988 } 988 }
989 } 989 }
990 990
991 void Zoom(Browser* browser, content::PageZoom zoom) { 991 void Zoom(Browser* browser, content::PageZoom zoom) {
992 ui_zoom::PageZoom::Zoom(browser->tab_strip_model()->GetActiveWebContents(), 992 zoom::PageZoom::Zoom(browser->tab_strip_model()->GetActiveWebContents(),
993 zoom); 993 zoom);
994 } 994 }
995 995
996 void FocusToolbar(Browser* browser) { 996 void FocusToolbar(Browser* browser) {
997 content::RecordAction(UserMetricsAction("FocusToolbar")); 997 content::RecordAction(UserMetricsAction("FocusToolbar"));
998 browser->window()->FocusToolbar(); 998 browser->window()->FocusToolbar();
999 } 999 }
1000 1000
1001 void FocusLocationBar(Browser* browser) { 1001 void FocusLocationBar(Browser* browser) {
1002 content::RecordAction(UserMetricsAction("FocusLocation")); 1002 content::RecordAction(UserMetricsAction("FocusLocation"));
1003 browser->window()->SetFocusToLocationBar(true); 1003 browser->window()->SetFocusToLocationBar(true);
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); 1289 app_name, true /* trusted_source */, gfx::Rect(), browser->profile()));
1290 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1290 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1291 1291
1292 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1292 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1293 contents->GetRenderViewHost()->SyncRendererPrefs(); 1293 contents->GetRenderViewHost()->SyncRendererPrefs();
1294 app_browser->window()->Show(); 1294 app_browser->window()->Show();
1295 } 1295 }
1296 #endif // defined(ENABLE_EXTENSIONS) 1296 #endif // defined(ENABLE_EXTENSIONS)
1297 1297
1298 } // namespace chrome 1298 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/browser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698