| 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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1124     content::NotificationService::current()->Notify( | 1124     content::NotificationService::current()->Notify( | 
| 1125         chrome::NOTIFICATION_OUTDATED_INSTALL_NO_AU, | 1125         chrome::NOTIFICATION_OUTDATED_INSTALL_NO_AU, | 
| 1126         content::NotificationService::AllSources(), | 1126         content::NotificationService::AllSources(), | 
| 1127         content::NotificationService::NoDetails()); | 1127         content::NotificationService::NoDetails()); | 
| 1128   } else { | 1128   } else { | 
| 1129     content::RecordAction(UserMetricsAction("UpdateChrome")); | 1129     content::RecordAction(UserMetricsAction("UpdateChrome")); | 
| 1130     browser->window()->ShowUpdateChromeDialog(); | 1130     browser->window()->ShowUpdateChromeDialog(); | 
| 1131   } | 1131   } | 
| 1132 } | 1132 } | 
| 1133 | 1133 | 
| 1134 void ToggleSpeechInput(Browser* browser) { |  | 
| 1135   SearchTabHelper* search_tab_helper = |  | 
| 1136       SearchTabHelper::FromWebContents( |  | 
| 1137           browser->tab_strip_model()->GetActiveWebContents()); |  | 
| 1138   // |search_tab_helper| can be null in unit tests. |  | 
| 1139   if (search_tab_helper) |  | 
| 1140     search_tab_helper->ToggleVoiceSearch(); |  | 
| 1141 } |  | 
| 1142 |  | 
| 1143 void DistillCurrentPage(Browser* browser) { | 1134 void DistillCurrentPage(Browser* browser) { | 
| 1144   DistillCurrentPageAndView(browser->tab_strip_model()->GetActiveWebContents()); | 1135   DistillCurrentPageAndView(browser->tab_strip_model()->GetActiveWebContents()); | 
| 1145 } | 1136 } | 
| 1146 | 1137 | 
| 1147 bool CanRequestTabletSite(WebContents* current_tab) { | 1138 bool CanRequestTabletSite(WebContents* current_tab) { | 
| 1148   return current_tab && | 1139   return current_tab && | 
| 1149       current_tab->GetController().GetLastCommittedEntry() != NULL; | 1140       current_tab->GetController().GetLastCommittedEntry() != NULL; | 
| 1150 } | 1141 } | 
| 1151 | 1142 | 
| 1152 bool IsRequestingTabletSite(Browser* browser) { | 1143 bool IsRequestingTabletSite(Browser* browser) { | 
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1329                                           browser->host_desktop_type())); | 1320                                           browser->host_desktop_type())); | 
| 1330   app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1321   app_browser->tab_strip_model()->AppendWebContents(contents, true); | 
| 1331 | 1322 | 
| 1332   contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1323   contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 
| 1333   contents->GetRenderViewHost()->SyncRendererPrefs(); | 1324   contents->GetRenderViewHost()->SyncRendererPrefs(); | 
| 1334   app_browser->window()->Show(); | 1325   app_browser->window()->Show(); | 
| 1335 } | 1326 } | 
| 1336 #endif  // defined(ENABLE_EXTENSIONS) | 1327 #endif  // defined(ENABLE_EXTENSIONS) | 
| 1337 | 1328 | 
| 1338 }  // namespace chrome | 1329 }  // namespace chrome | 
| OLD | NEW | 
|---|