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

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

Issue 11198025: Site specific secondary tiles for Windows 8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Created 8 years, 1 month 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 | « no previous file | chrome/browser/ui/metro_pin_tab_helper.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 27 matching lines...) Expand all
38 #include "chrome/browser/ui/browser_finder.h" 38 #include "chrome/browser/ui/browser_finder.h"
39 #include "chrome/browser/ui/browser_instant_controller.h" 39 #include "chrome/browser/ui/browser_instant_controller.h"
40 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" 40 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
41 #include "chrome/browser/ui/browser_tabstrip.h" 41 #include "chrome/browser/ui/browser_tabstrip.h"
42 #include "chrome/browser/ui/browser_window.h" 42 #include "chrome/browser/ui/browser_window.h"
43 #include "chrome/browser/ui/chrome_pages.h" 43 #include "chrome/browser/ui/chrome_pages.h"
44 #include "chrome/browser/ui/constrained_window_tab_helper.h" 44 #include "chrome/browser/ui/constrained_window_tab_helper.h"
45 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 45 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
46 #include "chrome/browser/ui/find_bar/find_tab_helper.h" 46 #include "chrome/browser/ui/find_bar/find_tab_helper.h"
47 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 47 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
48 #include "chrome/browser/ui/metro_pin_tab_helper.h"
49 #include "chrome/browser/ui/omnibox/location_bar.h" 48 #include "chrome/browser/ui/omnibox/location_bar.h"
50 #include "chrome/browser/ui/search/search.h" 49 #include "chrome/browser/ui/search/search.h"
51 #include "chrome/browser/ui/search/search_model.h" 50 #include "chrome/browser/ui/search/search_model.h"
52 #include "chrome/browser/ui/status_bubble.h" 51 #include "chrome/browser/ui/status_bubble.h"
53 #include "chrome/browser/ui/tab_contents/tab_contents.h" 52 #include "chrome/browser/ui/tab_contents/tab_contents.h"
54 #include "chrome/browser/ui/tabs/tab_strip_model.h" 53 #include "chrome/browser/ui/tabs/tab_strip_model.h"
55 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" 54 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
56 #include "chrome/browser/web_applications/web_app.h" 55 #include "chrome/browser/web_applications/web_app.h"
57 #include "chrome/common/chrome_switches.h" 56 #include "chrome/common/chrome_switches.h"
58 #include "chrome/common/pref_names.h" 57 #include "chrome/common/pref_names.h"
(...skipping 14 matching lines...) Expand all
73 #include "webkit/glue/web_intent_data.h" 72 #include "webkit/glue/web_intent_data.h"
74 #include "webkit/glue/webkit_glue.h" 73 #include "webkit/glue/webkit_glue.h"
75 #include "webkit/user_agent/user_agent_util.h" 74 #include "webkit/user_agent/user_agent_util.h"
76 75
77 #if defined(OS_MACOSX) 76 #if defined(OS_MACOSX)
78 #include "ui/base/cocoa/find_pasteboard.h" 77 #include "ui/base/cocoa/find_pasteboard.h"
79 #endif 78 #endif
80 79
81 #if defined(OS_WIN) 80 #if defined(OS_WIN)
82 #include "base/win/metro.h" 81 #include "base/win/metro.h"
82 #include "chrome/browser/ui/metro_pin_tab_helper_win.h"
83 #endif 83 #endif
84 84
85 namespace { 85 namespace {
86 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3"; 86 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3";
87 } 87 }
88 88
89 using content::NavigationController; 89 using content::NavigationController;
90 using content::NavigationEntry; 90 using content::NavigationEntry;
91 using content::OpenURLParams; 91 using content::OpenURLParams;
92 using content::Referrer; 92 using content::Referrer;
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 644
645 void BookmarkAllTabs(Browser* browser) { 645 void BookmarkAllTabs(Browser* browser) {
646 chrome::ShowBookmarkAllTabsDialog(browser); 646 chrome::ShowBookmarkAllTabsDialog(browser);
647 } 647 }
648 648
649 bool CanBookmarkAllTabs(const Browser* browser) { 649 bool CanBookmarkAllTabs(const Browser* browser) {
650 return browser->tab_count() > 1 && CanBookmarkCurrentPage(browser); 650 return browser->tab_count() > 1 && CanBookmarkCurrentPage(browser);
651 } 651 }
652 652
653 void TogglePagePinnedToStartScreen(Browser* browser) { 653 void TogglePagePinnedToStartScreen(Browser* browser) {
654 #if defined(OS_WIN)
654 MetroPinTabHelper::FromWebContents(GetActiveWebContents(browser))-> 655 MetroPinTabHelper::FromWebContents(GetActiveWebContents(browser))->
655 TogglePinnedToStartScreen(); 656 TogglePinnedToStartScreen();
657 #endif
656 } 658 }
657 659
658 void SavePage(Browser* browser) { 660 void SavePage(Browser* browser) {
659 content::RecordAction(UserMetricsAction("SavePage")); 661 content::RecordAction(UserMetricsAction("SavePage"));
660 WebContents* current_tab = GetActiveWebContents(browser); 662 WebContents* current_tab = GetActiveWebContents(browser);
661 if (current_tab && current_tab->GetContentsMimeType() == "application/pdf") 663 if (current_tab && current_tab->GetContentsMimeType() == "application/pdf")
662 content::RecordAction(UserMetricsAction("PDF.SavePage")); 664 content::RecordAction(UserMetricsAction("PDF.SavePage"));
663 current_tab->OnSavePage(); 665 current_tab->OnSavePage();
664 } 666 }
665 667
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 BrowserCommandsTabContentsCreator::CreateTabContents(contents); 1073 BrowserCommandsTabContentsCreator::CreateTabContents(contents);
1072 } 1074 }
1073 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); 1075 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true);
1074 1076
1075 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1077 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1076 contents->GetRenderViewHost()->SyncRendererPrefs(); 1078 contents->GetRenderViewHost()->SyncRendererPrefs();
1077 app_browser->window()->Show(); 1079 app_browser->window()->Show();
1078 } 1080 }
1079 1081
1080 } // namespace chrome 1082 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/metro_pin_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698