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

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

Issue 194383002: Show dialog as separate post task. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/printing/print_view_manager_base.cc ('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 10
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( 832 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
833 web_ui()->GetController()); 833 web_ui()->GetController());
834 print_preview_ui->OnHidePreviewDialog(); 834 print_preview_ui->OnHidePreviewDialog();
835 } 835 }
836 836
837 void PrintPreviewHandler::HandleCancelPendingPrintRequest( 837 void PrintPreviewHandler::HandleCancelPendingPrintRequest(
838 const base::ListValue* /*args*/) { 838 const base::ListValue* /*args*/) {
839 WebContents* initiator = GetInitiator(); 839 WebContents* initiator = GetInitiator();
840 if (initiator) 840 if (initiator)
841 ClearInitiatorDetails(); 841 ClearInitiatorDetails();
842 gfx::NativeWindow parent = initiator ? 842 chrome::ShowPrintErrorDialog();
843 initiator->GetView()->GetTopLevelNativeWindow() :
844 NULL;
845 chrome::ShowPrintErrorDialog(parent);
846 } 843 }
847 844
848 void PrintPreviewHandler::HandleSaveAppState(const base::ListValue* args) { 845 void PrintPreviewHandler::HandleSaveAppState(const base::ListValue* args) {
849 std::string data_to_save; 846 std::string data_to_save;
850 printing::StickySettings* sticky_settings = GetStickySettings(); 847 printing::StickySettings* sticky_settings = GetStickySettings();
851 if (args->GetString(0, &data_to_save) && !data_to_save.empty()) 848 if (args->GetString(0, &data_to_save) && !data_to_save.empty())
852 sticky_settings->StoreAppState(data_to_save); 849 sticky_settings->StoreAppState(data_to_save);
853 sticky_settings->SaveInPrefs(Profile::FromBrowserContext( 850 sticky_settings->SaveInPrefs(Profile::FromBrowserContext(
854 preview_web_contents()->GetBrowserContext())->GetPrefs()); 851 preview_web_contents()->GetBrowserContext())->GetPrefs());
855 } 852 }
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 printer_value->SetString("name", description.name); 1539 printer_value->SetString("name", description.name);
1543 printer_value->SetBoolean("hasLocalPrinting", has_local_printing); 1540 printer_value->SetBoolean("hasLocalPrinting", has_local_printing);
1544 printer_value->SetBoolean( 1541 printer_value->SetBoolean(
1545 "isUnregistered", 1542 "isUnregistered",
1546 description.id.empty() && 1543 description.id.empty() &&
1547 command_line->HasSwitch(switches::kEnablePrintPreviewRegisterPromos)); 1544 command_line->HasSwitch(switches::kEnablePrintPreviewRegisterPromos));
1548 printer_value->SetString("cloudID", description.id); 1545 printer_value->SetString("cloudID", description.id);
1549 } 1546 }
1550 1547
1551 #endif 1548 #endif
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_view_manager_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698