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

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 10867004: Notify print preview UI if getting capabilityes failed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/webui/print_preview/print_preview_handler.h ('k') | no next file » | 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/webui/print_preview/print_preview_handler.h" 5 #include "chrome/browser/ui/webui/print_preview/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 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 if (GetStickySettings()->color_model() != printing::UNKNOWN_COLOR_MODEL) { 768 if (GetStickySettings()->color_model() != printing::UNKNOWN_COLOR_MODEL) {
769 settings->SetBoolean( 769 settings->SetBoolean(
770 printing::kSettingSetColorAsDefault, 770 printing::kSettingSetColorAsDefault,
771 printing::isColorModelSelected( 771 printing::isColorModelSelected(
772 GetStickySettings()->color_model())); 772 GetStickySettings()->color_model()));
773 } 773 }
774 web_ui()->CallJavascriptFunction("updateWithPrinterCapabilities", 774 web_ui()->CallJavascriptFunction("updateWithPrinterCapabilities",
775 *settings); 775 *settings);
776 } 776 }
777 777
778 void PrintPreviewHandler::SendFailedToGetPrinterCapabilities(
779 const std::string& printer_name) {
780 VLOG(1) << "Get printer capabilities failed";
781 base::StringValue printer_name_value(printer_name);
782 web_ui()->CallJavascriptFunction("failedToGetPrinterCapabilities",
783 printer_name_value);
784 }
785
778 void PrintPreviewHandler::SetupPrinterList(const ListValue& printers) { 786 void PrintPreviewHandler::SetupPrinterList(const ListValue& printers) {
779 web_ui()->CallJavascriptFunction("setPrinters", printers); 787 web_ui()->CallJavascriptFunction("setPrinters", printers);
780 } 788 }
781 789
782 void PrintPreviewHandler::SendCloudPrintEnabled() { 790 void PrintPreviewHandler::SendCloudPrintEnabled() {
783 Profile* profile = Profile::FromBrowserContext( 791 Profile* profile = Profile::FromBrowserContext(
784 preview_web_contents()->GetBrowserContext()); 792 preview_web_contents()->GetBrowserContext());
785 PrefService* prefs = profile->GetPrefs(); 793 PrefService* prefs = profile->GetPrefs();
786 if (prefs->GetBoolean(prefs::kCloudPrintSubmitEnabled)) { 794 if (prefs->GetBoolean(prefs::kCloudPrintSubmitEnabled)) {
787 GURL gcp_url(CloudPrintURL(profile).GetCloudPrintServiceURL()); 795 GURL gcp_url(CloudPrintURL(profile).GetCloudPrintServiceURL());
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 return; 969 return;
962 970
963 // We no longer require the initiator tab details. Remove those details 971 // We no longer require the initiator tab details. Remove those details
964 // associated with the preview tab to allow the initiator tab to create 972 // associated with the preview tab to allow the initiator tab to create
965 // another preview tab. 973 // another preview tab.
966 printing::PrintPreviewTabController* tab_controller = 974 printing::PrintPreviewTabController* tab_controller =
967 printing::PrintPreviewTabController::GetInstance(); 975 printing::PrintPreviewTabController::GetInstance();
968 if (tab_controller) 976 if (tab_controller)
969 tab_controller->EraseInitiatorTabInfo(preview_tab_contents()); 977 tab_controller->EraseInitiatorTabInfo(preview_tab_contents());
970 } 978 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698