OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webui/print_preview_handler.h" | 5 #include "chrome/browser/ui/webui/print_preview_handler.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 // http://code.google.com/p/chromium/issues/detail?id=44093 | 863 // http://code.google.com/p/chromium/issues/detail?id=44093 |
864 ActivateInitiatorTabAndClosePreviewTab(); | 864 ActivateInitiatorTabAndClosePreviewTab(); |
865 } | 865 } |
866 | 866 |
867 void PrintPreviewHandler::HandleManageCloudPrint(const ListValue* /*args*/) { | 867 void PrintPreviewHandler::HandleManageCloudPrint(const ListValue* /*args*/) { |
868 Browser* browser = BrowserList::GetLastActive(); | 868 Browser* browser = BrowserList::GetLastActive(); |
869 browser->OpenURL(CloudPrintURL(browser->profile()). | 869 browser->OpenURL(CloudPrintURL(browser->profile()). |
870 GetCloudPrintServiceManageURL(), | 870 GetCloudPrintServiceManageURL(), |
871 GURL(), | 871 GURL(), |
872 NEW_FOREGROUND_TAB, | 872 NEW_FOREGROUND_TAB, |
873 PageTransition::LINK); | 873 content::PAGE_TRANSITION_LINK); |
874 } | 874 } |
875 | 875 |
876 void PrintPreviewHandler::HandleShowSystemDialog(const ListValue* /*args*/) { | 876 void PrintPreviewHandler::HandleShowSystemDialog(const ListValue* /*args*/) { |
877 ReportStats(); | 877 ReportStats(); |
878 ReportUserActionHistogram(FALLBACK_TO_ADVANCED_SETTINGS_DIALOG); | 878 ReportUserActionHistogram(FALLBACK_TO_ADVANCED_SETTINGS_DIALOG); |
879 | 879 |
880 TabContentsWrapper* initiator_tab = GetInitiatorTab(); | 880 TabContentsWrapper* initiator_tab = GetInitiatorTab(); |
881 if (!initiator_tab) | 881 if (!initiator_tab) |
882 return; | 882 return; |
883 | 883 |
(...skipping 15 matching lines...) Expand all Loading... |
899 const ListValue* /*args*/) { | 899 const ListValue* /*args*/) { |
900 ReportStats(); | 900 ReportStats(); |
901 ReportUserActionHistogram(INITIATOR_TAB_CRASHED); | 901 ReportUserActionHistogram(INITIATOR_TAB_CRASHED); |
902 | 902 |
903 TabContentsWrapper* initiator_tab = GetInitiatorTab(); | 903 TabContentsWrapper* initiator_tab = GetInitiatorTab(); |
904 if (!initiator_tab) | 904 if (!initiator_tab) |
905 return; | 905 return; |
906 | 906 |
907 TabContents* contents = initiator_tab->tab_contents(); | 907 TabContents* contents = initiator_tab->tab_contents(); |
908 contents->OpenURL(contents->GetURL(), GURL(), CURRENT_TAB, | 908 contents->OpenURL(contents->GetURL(), GURL(), CURRENT_TAB, |
909 PageTransition::RELOAD); | 909 content::PAGE_TRANSITION_RELOAD); |
910 ActivateInitiatorTabAndClosePreviewTab(); | 910 ActivateInitiatorTabAndClosePreviewTab(); |
911 } | 911 } |
912 | 912 |
913 void PrintPreviewHandler::HandleClosePreviewTab(const ListValue* /*args*/) { | 913 void PrintPreviewHandler::HandleClosePreviewTab(const ListValue* /*args*/) { |
914 ReportStats(); | 914 ReportStats(); |
915 ReportUserActionHistogram(CANCEL); | 915 ReportUserActionHistogram(CANCEL); |
916 | 916 |
917 // Record the number of times the user requests to regenerate preview data | 917 // Record the number of times the user requests to regenerate preview data |
918 // before cancelling. | 918 // before cancelling. |
919 UMA_HISTOGRAM_COUNTS("PrintPreview.RegeneratePreviewRequest.BeforeCancel", | 919 UMA_HISTOGRAM_COUNTS("PrintPreview.RegeneratePreviewRequest.BeforeCancel", |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 return; | 1162 return; |
1163 | 1163 |
1164 // We no longer require the initiator tab details. Remove those details | 1164 // We no longer require the initiator tab details. Remove those details |
1165 // associated with the preview tab to allow the initiator tab to create | 1165 // associated with the preview tab to allow the initiator tab to create |
1166 // another preview tab. | 1166 // another preview tab. |
1167 printing::PrintPreviewTabController* tab_controller = | 1167 printing::PrintPreviewTabController* tab_controller = |
1168 printing::PrintPreviewTabController::GetInstance(); | 1168 printing::PrintPreviewTabController::GetInstance(); |
1169 if (tab_controller) | 1169 if (tab_controller) |
1170 tab_controller->EraseInitiatorTabInfo(preview_tab_wrapper()); | 1170 tab_controller->EraseInitiatorTabInfo(preview_tab_wrapper()); |
1171 } | 1171 } |
OLD | NEW |