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

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

Issue 10801006: Allow secondary tiles to be unpinned. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/browser_win.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 (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_editor.h" 10 #include "chrome/browser/bookmarks/bookmark_editor.h"
(...skipping 23 matching lines...) Expand all
34 #include "chrome/browser/ui/browser_command_controller.h" 34 #include "chrome/browser/ui/browser_command_controller.h"
35 #include "chrome/browser/ui/browser_finder.h" 35 #include "chrome/browser/ui/browser_finder.h"
36 #include "chrome/browser/ui/browser_instant_controller.h" 36 #include "chrome/browser/ui/browser_instant_controller.h"
37 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" 37 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
38 #include "chrome/browser/ui/browser_tabstrip.h" 38 #include "chrome/browser/ui/browser_tabstrip.h"
39 #include "chrome/browser/ui/browser_window.h" 39 #include "chrome/browser/ui/browser_window.h"
40 #include "chrome/browser/ui/constrained_window_tab_helper.h" 40 #include "chrome/browser/ui/constrained_window_tab_helper.h"
41 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 41 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
42 #include "chrome/browser/ui/find_bar/find_tab_helper.h" 42 #include "chrome/browser/ui/find_bar/find_tab_helper.h"
43 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 43 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
44 #include "chrome/browser/ui/metro_pin_tab_helper.h"
44 #include "chrome/browser/ui/omnibox/location_bar.h" 45 #include "chrome/browser/ui/omnibox/location_bar.h"
45 #include "chrome/browser/ui/search/search.h" 46 #include "chrome/browser/ui/search/search.h"
46 #include "chrome/browser/ui/search/search_model.h" 47 #include "chrome/browser/ui/search/search_model.h"
47 #include "chrome/browser/ui/status_bubble.h" 48 #include "chrome/browser/ui/status_bubble.h"
48 #include "chrome/browser/ui/tab_contents/tab_contents.h" 49 #include "chrome/browser/ui/tab_contents/tab_contents.h"
49 #include "chrome/browser/ui/tabs/tab_strip_model.h" 50 #include "chrome/browser/ui/tabs/tab_strip_model.h"
50 #include "chrome/browser/ui/webui/feedback_ui.h" 51 #include "chrome/browser/ui/webui/feedback_ui.h"
51 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" 52 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
52 #include "chrome/browser/web_applications/web_app.h" 53 #include "chrome/browser/web_applications/web_app.h"
53 #include "chrome/common/chrome_switches.h" 54 #include "chrome/common/chrome_switches.h"
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 } 593 }
593 594
594 void BookmarkAllTabs(Browser* browser) { 595 void BookmarkAllTabs(Browser* browser) {
595 BookmarkEditor::ShowBookmarkAllTabsDialog(browser); 596 BookmarkEditor::ShowBookmarkAllTabsDialog(browser);
596 } 597 }
597 598
598 bool CanBookmarkAllTabs(const Browser* browser) { 599 bool CanBookmarkAllTabs(const Browser* browser) {
599 return browser->tab_count() > 1 && CanBookmarkCurrentPage(browser); 600 return browser->tab_count() > 1 && CanBookmarkCurrentPage(browser);
600 } 601 }
601 602
602 #if !defined(OS_WIN) 603 void TogglePagePinnedToStartScreen(Browser* browser) {
603 void PinCurrentPageToStartScreen(Browser* browser) { 604 TabContents* current_tab = GetActiveTabContents(browser);
605 if (current_tab)
sky 2012/07/18 15:21:55 You shouldn't need a NULL check here.
606 current_tab->metro_pin_tab_helper()->TogglePinnedToStartScreen();
604 } 607 }
605 #endif
606 608
607 void SavePage(Browser* browser) { 609 void SavePage(Browser* browser) {
608 content::RecordAction(UserMetricsAction("SavePage")); 610 content::RecordAction(UserMetricsAction("SavePage"));
609 WebContents* current_tab = GetActiveWebContents(browser); 611 WebContents* current_tab = GetActiveWebContents(browser);
610 if (current_tab && current_tab->GetContentsMimeType() == "application/pdf") 612 if (current_tab && current_tab->GetContentsMimeType() == "application/pdf")
611 content::RecordAction(UserMetricsAction("PDF.SavePage")); 613 content::RecordAction(UserMetricsAction("PDF.SavePage"));
612 current_tab->OnSavePage(); 614 current_tab->OnSavePage();
613 } 615 }
614 616
615 bool CanSavePage(const Browser* browser) { 617 bool CanSavePage(const Browser* browser) {
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 if (!tab_contents) 985 if (!tab_contents)
984 tab_contents = new TabContents(contents); 986 tab_contents = new TabContents(contents);
985 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); 987 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true);
986 988
987 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 989 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
988 contents->GetRenderViewHost()->SyncRendererPrefs(); 990 contents->GetRenderViewHost()->SyncRendererPrefs();
989 app_browser->window()->Show(); 991 app_browser->window()->Show();
990 } 992 }
991 993
992 } // namespace chrome 994 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/browser_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698