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

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

Issue 10891033: Switch MetroPinTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small clean Created 8 years, 3 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 | « 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_editor.h" 10 #include "chrome/browser/bookmarks/bookmark_editor.h"
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 602
603 void BookmarkAllTabs(Browser* browser) { 603 void BookmarkAllTabs(Browser* browser) {
604 BookmarkEditor::ShowBookmarkAllTabsDialog(browser); 604 BookmarkEditor::ShowBookmarkAllTabsDialog(browser);
605 } 605 }
606 606
607 bool CanBookmarkAllTabs(const Browser* browser) { 607 bool CanBookmarkAllTabs(const Browser* browser) {
608 return browser->tab_count() > 1 && CanBookmarkCurrentPage(browser); 608 return browser->tab_count() > 1 && CanBookmarkCurrentPage(browser);
609 } 609 }
610 610
611 void TogglePagePinnedToStartScreen(Browser* browser) { 611 void TogglePagePinnedToStartScreen(Browser* browser) {
612 GetActiveTabContents(browser)->metro_pin_tab_helper()-> 612 MetroPinTabHelper::FromWebContents(GetActiveWebContents(browser))->
613 TogglePinnedToStartScreen(); 613 TogglePinnedToStartScreen();
614 } 614 }
615 615
616 void SavePage(Browser* browser) { 616 void SavePage(Browser* browser) {
617 content::RecordAction(UserMetricsAction("SavePage")); 617 content::RecordAction(UserMetricsAction("SavePage"));
618 WebContents* current_tab = GetActiveWebContents(browser); 618 WebContents* current_tab = GetActiveWebContents(browser);
619 if (current_tab && current_tab->GetContentsMimeType() == "application/pdf") 619 if (current_tab && current_tab->GetContentsMimeType() == "application/pdf")
620 content::RecordAction(UserMetricsAction("PDF.SavePage")); 620 content::RecordAction(UserMetricsAction("PDF.SavePage"));
621 current_tab->OnSavePage(); 621 current_tab->OnSavePage();
622 } 622 }
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 BrowserCommandsTabContentsCreator::CreateTabContents(contents); 998 BrowserCommandsTabContentsCreator::CreateTabContents(contents);
999 } 999 }
1000 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); 1000 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true);
1001 1001
1002 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1002 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1003 contents->GetRenderViewHost()->SyncRendererPrefs(); 1003 contents->GetRenderViewHost()->SyncRendererPrefs();
1004 app_browser->window()->Show(); 1004 app_browser->window()->Show();
1005 } 1005 }
1006 1006
1007 } // namespace chrome 1007 } // 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