Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / login / screens / screen_flow.h
blobddc39001e47f931ea8a5ff6f7d3c708752ea9685
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_FLOW_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_FLOW_H_
8 #include <string>
10 #include "base/basictypes.h"
12 namespace chromeos {
14 class ScreenContext;
15 class ScreenManager;
17 // Class that holds the logic of interpreting screen outcomes and moving between
18 // the screens.
19 class ScreenFlow {
20 public:
21 ScreenFlow();
22 virtual ~ScreenFlow();
24 // Called once the flow is set as a flow for specific screen manager.
25 // Should usually result in get_manager()->ShowScreen call.
26 virtual void Start() = 0;
28 // Called when screen with |screen_id| finishes with |outcome|.
29 // Additional result parameters may be passed via |context| (always not NULL).
30 // Should result in get_manager()->ShowScreen call or in
31 // get_manager()->SetScreenFlow call.
32 virtual void OnScreenFinished(const std::string& screen_id,
33 const std::string& outcome,
34 ScreenContext* context) = 0;
35 protected:
36 ScreenManager* screen_manager() { return manager_; }
38 private:
39 friend class ScreenManager;
41 void set_screen_manager(ScreenManager* manager) {
42 manager_ = manager;
45 // Screen manager associated with this flow. Set by screen manager itself.
46 ScreenManager* manager_;
48 DISALLOW_COPY_AND_ASSIGN(ScreenFlow);
51 } // namespace chromeos
53 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_FLOW_H_