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

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

Issue 7647026: base: Add three helper functions to Values API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a typo Ceate -> Create Created 9 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
OLDNEW
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 <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #if !defined(OS_CHROMEOS) 10 #if !defined(OS_CHROMEOS)
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 const StringValue& default_printer, 686 const StringValue& default_printer,
687 const StringValue& cloud_print_data) { 687 const StringValue& cloud_print_data) {
688 web_ui_->CallJavascriptFunction("setDefaultPrinter", 688 web_ui_->CallJavascriptFunction("setDefaultPrinter",
689 default_printer, 689 default_printer,
690 cloud_print_data); 690 cloud_print_data);
691 } 691 }
692 692
693 void PrintPreviewHandler::SetupPrinterList(const ListValue& printers) { 693 void PrintPreviewHandler::SetupPrinterList(const ListValue& printers) {
694 SendCloudPrintEnabled(); 694 SendCloudPrintEnabled();
695 web_ui_->CallJavascriptFunction("setPrinters", printers, 695 web_ui_->CallJavascriptFunction("setPrinters", printers,
696 *(Value::CreateBooleanValue(true))); 696 *(base::TrueValue()));
697 } 697 }
698 698
699 void PrintPreviewHandler::SendCloudPrintEnabled() { 699 void PrintPreviewHandler::SendCloudPrintEnabled() {
700 #if defined(OS_CHROMEOS) 700 #if defined(OS_CHROMEOS)
701 bool enable_cloud_print_integration = true; 701 bool enable_cloud_print_integration = true;
702 #else 702 #else
703 bool enable_cloud_print_integration = 703 bool enable_cloud_print_integration =
704 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableCloudPrint); 704 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableCloudPrint);
705 #endif 705 #endif
706 GURL gcp_url(CloudPrintURL(BrowserList::GetLastActive()->profile()). 706 GURL gcp_url(CloudPrintURL(BrowserList::GetLastActive()->profile()).
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 return; 887 return;
888 888
889 // We no longer require the initiator tab details. Remove those details 889 // We no longer require the initiator tab details. Remove those details
890 // associated with the preview tab to allow the initiator tab to create 890 // associated with the preview tab to allow the initiator tab to create
891 // another preview tab. 891 // another preview tab.
892 printing::PrintPreviewTabController* tab_controller = 892 printing::PrintPreviewTabController* tab_controller =
893 printing::PrintPreviewTabController::GetInstance(); 893 printing::PrintPreviewTabController::GetInstance();
894 if (tab_controller) 894 if (tab_controller)
895 tab_controller->EraseInitiatorTabInfo(preview_tab()); 895 tab_controller->EraseInitiatorTabInfo(preview_tab());
896 } 896 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/personal_options_handler.cc ('k') | chrome/browser/ui/webui/sync_internals_ui_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698