Home | History | Annotate | Download | only in first_run
      1 // Copyright 2013 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_UI_WEBUI_CHROMEOS_FIRST_RUN_FIRST_RUN_HANDLER_H_
      6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_FIRST_RUN_FIRST_RUN_HANDLER_H_
      7 
      8 #include <string>
      9 
     10 #include "base/compiler_specific.h"
     11 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_actor.h"
     12 #include "content/public/browser/web_ui_message_handler.h"
     13 
     14 namespace chromeos {
     15 
     16 class StepPosition;
     17 
     18 class FirstRunHandler : public FirstRunActor,
     19                         public content::WebUIMessageHandler {
     20  public:
     21   FirstRunHandler();
     22   // Overriden from FirstRunActor.
     23   virtual bool IsInitialized() OVERRIDE;
     24   virtual void SetBackgroundVisible(bool visible) OVERRIDE;
     25   virtual void AddRectangularHole(int x, int y, int width, int height) OVERRIDE;
     26   virtual void AddRoundHole(int x, int y, float radius) OVERRIDE;
     27   virtual void RemoveBackgroundHoles() OVERRIDE;
     28   virtual void ShowStepPositioned(const std::string& name,
     29                                   const StepPosition& position) OVERRIDE;
     30   virtual void ShowStepPointingTo(const std::string& name,
     31                                   int x,
     32                                   int y,
     33                                   int offset) OVERRIDE;
     34   virtual void HideCurrentStep() OVERRIDE;
     35   virtual void Finalize() OVERRIDE;
     36   virtual bool IsFinalizing() OVERRIDE;
     37 
     38  private:
     39   // Overriden from content::WebUIMessageHandler.
     40   virtual void RegisterMessages() OVERRIDE;
     41 
     42   // Handlers for calls from JS.
     43   void HandleInitialized(const base::ListValue* args);
     44   void HandleNextButtonClicked(const base::ListValue* args);
     45   void HandleHelpButtonClicked(const base::ListValue* args);
     46   void HandleStepShown(const base::ListValue* args);
     47   void HandleStepHidden(const base::ListValue* args);
     48   void HandleFinalized(const base::ListValue* args);
     49 
     50   bool is_initialized_;
     51   bool is_finalizing_;
     52 
     53   DISALLOW_COPY_AND_ASSIGN(FirstRunHandler);
     54 };
     55 
     56 }  // namespace chromeos
     57 
     58 #endif  // CHROME_BROWSER_UI_WEBUI_CHROMEOS_FIRST_RUN_FIRST_RUN_HANDLER_H_
     59 
     60