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/scoped_ptr.h" | |
8 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
10 #include "chrome/browser/dom_ui/web_ui_util.h" | 9 #include "base/scoped_ptr.h" |
11 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" | 10 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" |
| 11 #include "chrome/browser/webui/web_ui_util.h" |
12 | 12 |
13 WebUIMessageHandler* CloudPrintSetupMessageHandler::Attach(WebUI* web_ui) { | 13 WebUIMessageHandler* CloudPrintSetupMessageHandler::Attach(WebUI* web_ui) { |
14 // Pass the WebUI object to the setup flow. | 14 // Pass the WebUI object to the setup flow. |
15 flow_->Attach(web_ui); | 15 flow_->Attach(web_ui); |
16 return WebUIMessageHandler::Attach(web_ui); | 16 return WebUIMessageHandler::Attach(web_ui); |
17 } | 17 } |
18 | 18 |
19 void CloudPrintSetupMessageHandler::RegisterMessages() { | 19 void CloudPrintSetupMessageHandler::RegisterMessages() { |
20 web_ui_->RegisterMessageCallback("SubmitAuth", | 20 web_ui_->RegisterMessageCallback("SubmitAuth", |
21 NewCallback(this, &CloudPrintSetupMessageHandler::HandleSubmitAuth)); | 21 NewCallback(this, &CloudPrintSetupMessageHandler::HandleSubmitAuth)); |
(...skipping 30 matching lines...) Expand all Loading... |
52 | 52 |
53 void CloudPrintSetupMessageHandler::HandlePrintTestPage(const ListValue* args) { | 53 void CloudPrintSetupMessageHandler::HandlePrintTestPage(const ListValue* args) { |
54 if (flow_) | 54 if (flow_) |
55 flow_->OnUserClickedPrintTestPage(); | 55 flow_->OnUserClickedPrintTestPage(); |
56 } | 56 } |
57 | 57 |
58 void CloudPrintSetupMessageHandler::HandleLearnMore(const ListValue* args) { | 58 void CloudPrintSetupMessageHandler::HandleLearnMore(const ListValue* args) { |
59 if (flow_) | 59 if (flow_) |
60 flow_->OnUserClickedLearnMore(); | 60 flow_->OnUserClickedLearnMore(); |
61 } | 61 } |
OLD | NEW |