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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_MESSAGE_HANDLER_H_ 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_MESSAGE_HANDLER_H_ 7 8 #include <string> 9 10 #include "base/values.h" 11 #include "chrome/browser/ui/webui/html_dialog_ui.h" 12 13 class CloudPrintSetupFlow; 14 15 // This class is used to handle DOM messages from the setup dialog. 16 class CloudPrintSetupMessageHandler : public WebUIMessageHandler { 17 public: 18 explicit CloudPrintSetupMessageHandler(CloudPrintSetupFlow* flow) 19 : flow_(flow) {} 20 virtual ~CloudPrintSetupMessageHandler() {} 21 22 // WebUIMessageHandler implementation. 23 virtual WebUIMessageHandler* Attach(WebUI* web_ui); 24 25 protected: 26 // WebUIMessageHandler implementation. 27 virtual void RegisterMessages(); 28 29 // Callbacks from the page. 30 void HandleSubmitAuth(const ListValue* args); 31 void HandlePrintTestPage(const ListValue* args); 32 void HandleLearnMore(const ListValue* args); 33 34 private: 35 CloudPrintSetupFlow* flow_; 36 37 DISALLOW_COPY_AND_ASSIGN(CloudPrintSetupMessageHandler); 38 }; 39 40 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_MESSAGE_HANDLER_H_ 41