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

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

Issue 269723009: Add UI in Aura for distilling web pages and update Chrome Shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model.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/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"
11 #include "chrome/app/chrome_command_ids.h" 11 #include "chrome/app/chrome_command_ids.h"
12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/browsing_data/browsing_data_helper.h" 14 #include "chrome/browser/browsing_data/browsing_data_helper.h"
15 #include "chrome/browser/browsing_data/browsing_data_remover.h" 15 #include "chrome/browser/browsing_data/browsing_data_remover.h"
16 #include "chrome/browser/chrome_notification_types.h" 16 #include "chrome/browser/chrome_notification_types.h"
17 #include "chrome/browser/chrome_page_zoom.h" 17 #include "chrome/browser/chrome_page_zoom.h"
18 #include "chrome/browser/devtools/devtools_window.h" 18 #include "chrome/browser/devtools/devtools_window.h"
19 #include "chrome/browser/dom_distiller/tab_utils.h"
19 #include "chrome/browser/extensions/api/commands/command_service.h" 20 #include "chrome/browser/extensions/api/commands/command_service.h"
20 #include "chrome/browser/extensions/tab_helper.h" 21 #include "chrome/browser/extensions/tab_helper.h"
21 #include "chrome/browser/favicon/favicon_tab_helper.h" 22 #include "chrome/browser/favicon/favicon_tab_helper.h"
22 #include "chrome/browser/google/google_util.h" 23 #include "chrome/browser/google/google_util.h"
23 #include "chrome/browser/lifetime/application_lifetime.h" 24 #include "chrome/browser/lifetime/application_lifetime.h"
24 #include "chrome/browser/platform_util.h" 25 #include "chrome/browser/platform_util.h"
25 #include "chrome/browser/prefs/incognito_mode_prefs.h" 26 #include "chrome/browser/prefs/incognito_mode_prefs.h"
26 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/browser/rlz/rlz.h" 28 #include "chrome/browser/rlz/rlz.h"
28 #include "chrome/browser/search/search.h" 29 #include "chrome/browser/search/search.h"
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 1066
1066 void ToggleSpeechInput(Browser* browser) { 1067 void ToggleSpeechInput(Browser* browser) {
1067 SearchTabHelper* search_tab_helper = 1068 SearchTabHelper* search_tab_helper =
1068 SearchTabHelper::FromWebContents( 1069 SearchTabHelper::FromWebContents(
1069 browser->tab_strip_model()->GetActiveWebContents()); 1070 browser->tab_strip_model()->GetActiveWebContents());
1070 // |search_tab_helper| can be null in unit tests. 1071 // |search_tab_helper| can be null in unit tests.
1071 if (search_tab_helper) 1072 if (search_tab_helper)
1072 search_tab_helper->ToggleVoiceSearch(); 1073 search_tab_helper->ToggleVoiceSearch();
1073 } 1074 }
1074 1075
1076 void DistillCurrentPage(Browser* browser) {
1077 DistillCurrentPageAndView(browser->tab_strip_model()->GetActiveWebContents());
1078 }
1079
1075 bool CanRequestTabletSite(WebContents* current_tab) { 1080 bool CanRequestTabletSite(WebContents* current_tab) {
1076 if (!current_tab) 1081 if (!current_tab)
1077 return false; 1082 return false;
1078 return current_tab->GetController().GetActiveEntry() != NULL; 1083 return current_tab->GetController().GetActiveEntry() != NULL;
1079 } 1084 }
1080 1085
1081 bool IsRequestingTabletSite(Browser* browser) { 1086 bool IsRequestingTabletSite(Browser* browser) {
1082 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); 1087 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents();
1083 if (!current_tab) 1088 if (!current_tab)
1084 return false; 1089 return false;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 browser->profile(), 1264 browser->profile(),
1260 browser->host_desktop_type())); 1265 browser->host_desktop_type()));
1261 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1266 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1262 1267
1263 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1268 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1264 contents->GetRenderViewHost()->SyncRendererPrefs(); 1269 contents->GetRenderViewHost()->SyncRendererPrefs();
1265 app_browser->window()->Show(); 1270 app_browser->window()->Show();
1266 } 1271 }
1267 1272
1268 } // namespace chrome 1273 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698