| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |