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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 chrome::NOTIFICATION_OUTDATED_INSTALL_NO_AU, | 1053 chrome::NOTIFICATION_OUTDATED_INSTALL_NO_AU, |
1054 content::NotificationService::AllSources(), | 1054 content::NotificationService::AllSources(), |
1055 content::NotificationService::NoDetails()); | 1055 content::NotificationService::NoDetails()); |
1056 } else { | 1056 } else { |
1057 content::RecordAction(UserMetricsAction("UpdateChrome")); | 1057 content::RecordAction(UserMetricsAction("UpdateChrome")); |
1058 browser->window()->ShowUpdateChromeDialog(); | 1058 browser->window()->ShowUpdateChromeDialog(); |
1059 } | 1059 } |
1060 } | 1060 } |
1061 | 1061 |
1062 void ToggleSpeechInput(Browser* browser) { | 1062 void ToggleSpeechInput(Browser* browser) { |
1063 WebContents* web_contents = | |
1064 browser->tab_strip_model()->GetActiveWebContents(); | |
1065 web_contents->GetRenderViewHost()->ToggleSpeechInput(); | |
1066 | |
1067 SearchTabHelper* search_tab_helper = | 1063 SearchTabHelper* search_tab_helper = |
1068 SearchTabHelper::FromWebContents(web_contents); | 1064 SearchTabHelper::FromWebContents( |
| 1065 browser->tab_strip_model()->GetActiveWebContents()); |
1069 // |search_tab_helper| can be null in unit tests. | 1066 // |search_tab_helper| can be null in unit tests. |
1070 if (search_tab_helper) | 1067 if (search_tab_helper) |
1071 search_tab_helper->ToggleVoiceSearch(); | 1068 search_tab_helper->ToggleVoiceSearch(); |
1072 } | 1069 } |
1073 | 1070 |
1074 bool CanRequestTabletSite(WebContents* current_tab) { | 1071 bool CanRequestTabletSite(WebContents* current_tab) { |
1075 if (!current_tab) | 1072 if (!current_tab) |
1076 return false; | 1073 return false; |
1077 return current_tab->GetController().GetActiveEntry() != NULL; | 1074 return current_tab->GetController().GetActiveEntry() != NULL; |
1078 } | 1075 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 browser->profile(), | 1255 browser->profile(), |
1259 browser->host_desktop_type())); | 1256 browser->host_desktop_type())); |
1260 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1257 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1261 | 1258 |
1262 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1259 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1263 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1260 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1264 app_browser->window()->Show(); | 1261 app_browser->window()->Show(); |
1265 } | 1262 } |
1266 | 1263 |
1267 } // namespace chrome | 1264 } // namespace chrome |
OLD | NEW |