| 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/printing/cloud_print/cloud_print_setup_message_handler.
h" | 5 #include "chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.
h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" | 12 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" |
| 13 #include "content/browser/webui/web_ui.h" |
| 13 | 14 |
| 14 void CloudPrintSetupMessageHandler::RegisterMessages() { | 15 void CloudPrintSetupMessageHandler::RegisterMessages() { |
| 15 // Pass the WebUI object to the setup flow. | 16 // Pass the WebUI object to the setup flow. |
| 16 flow_->Attach(web_ui()); | 17 flow_->Attach(web_ui()); |
| 17 | 18 |
| 18 web_ui()->RegisterMessageCallback("SubmitAuth", | 19 web_ui()->RegisterMessageCallback("SubmitAuth", |
| 19 base::Bind(&CloudPrintSetupMessageHandler::HandleSubmitAuth, | 20 base::Bind(&CloudPrintSetupMessageHandler::HandleSubmitAuth, |
| 20 base::Unretained(this))); | 21 base::Unretained(this))); |
| 21 web_ui()->RegisterMessageCallback("PrintTestPage", | 22 web_ui()->RegisterMessageCallback("PrintTestPage", |
| 22 base::Bind(&CloudPrintSetupMessageHandler::HandlePrintTestPage, | 23 base::Bind(&CloudPrintSetupMessageHandler::HandlePrintTestPage, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 58 |
| 58 void CloudPrintSetupMessageHandler::HandlePrintTestPage(const ListValue* args) { | 59 void CloudPrintSetupMessageHandler::HandlePrintTestPage(const ListValue* args) { |
| 59 if (flow_) | 60 if (flow_) |
| 60 flow_->OnUserClickedPrintTestPage(); | 61 flow_->OnUserClickedPrintTestPage(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 void CloudPrintSetupMessageHandler::HandleLearnMore(const ListValue* args) { | 64 void CloudPrintSetupMessageHandler::HandleLearnMore(const ListValue* args) { |
| 64 if (flow_) | 65 if (flow_) |
| 65 flow_->OnUserClickedLearnMore(); | 66 flow_->OnUserClickedLearnMore(); |
| 66 } | 67 } |
| OLD | NEW |