OLD | NEW |
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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 // Incognito window it's the newest value of the find pboard content and | 885 // Incognito window it's the newest value of the find pboard content and |
886 // user-typed text. | 886 // user-typed text. |
887 FindBar* find_bar = browser->GetFindBarController()->find_bar(); | 887 FindBar* find_bar = browser->GetFindBarController()->find_bar(); |
888 find_text = find_bar->GetFindText(); | 888 find_text = find_bar->GetFindText(); |
889 #endif | 889 #endif |
890 find_helper->StartFinding(find_text, forward_direction, false); | 890 find_helper->StartFinding(find_text, forward_direction, false); |
891 } | 891 } |
892 } | 892 } |
893 | 893 |
894 void Zoom(Browser* browser, content::PageZoom zoom) { | 894 void Zoom(Browser* browser, content::PageZoom zoom) { |
895 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); | 895 chrome_page_zoom::Zoom(browser->tab_strip_model()->GetActiveWebContents(), |
896 DevToolsWindow* devtools = | 896 zoom); |
897 DevToolsWindow::GetDockedInstanceForInspectedTab(contents); | |
898 if (devtools && devtools->web_contents()->GetRenderWidgetHostView() && | |
899 devtools->web_contents()->GetRenderWidgetHostView()->HasFocus()) { | |
900 chrome_page_zoom::Zoom(devtools->web_contents(), zoom); | |
901 return; | |
902 } | |
903 | |
904 chrome_page_zoom::Zoom(contents, zoom); | |
905 } | 897 } |
906 | 898 |
907 void FocusToolbar(Browser* browser) { | 899 void FocusToolbar(Browser* browser) { |
908 content::RecordAction(UserMetricsAction("FocusToolbar")); | 900 content::RecordAction(UserMetricsAction("FocusToolbar")); |
909 browser->window()->FocusToolbar(); | 901 browser->window()->FocusToolbar(); |
910 } | 902 } |
911 | 903 |
912 void FocusLocationBar(Browser* browser) { | 904 void FocusLocationBar(Browser* browser) { |
913 content::RecordAction(UserMetricsAction("FocusLocation")); | 905 content::RecordAction(UserMetricsAction("FocusLocation")); |
914 browser->window()->SetFocusToLocationBar(true); | 906 browser->window()->SetFocusToLocationBar(true); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1181 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
1190 browser->host_desktop_type())); | 1182 browser->host_desktop_type())); |
1191 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1183 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1192 | 1184 |
1193 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1185 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1194 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1186 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1195 app_browser->window()->Show(); | 1187 app_browser->window()->Show(); |
1196 } | 1188 } |
1197 | 1189 |
1198 } // namespace chrome | 1190 } // namespace chrome |
OLD | NEW |