15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/compiler_specific.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/ref_counted.h"
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "chrome/browser/chromeos/login/ui/login_web_dialog.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/native_widget_types.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
14a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class Profile;
15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace chromeos {
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Provides help content during OOBE / login.
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Based on connectivity state (offline/online) shows help topic dialog
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// or launches HelpApp in BWSI mode.
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class HelpAppLauncher : public base::RefCountedThreadSafe<HelpAppLauncher> {
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // IDs of help topics available from HelpApp.
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  enum HelpTopic {
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Showed on basic connectivity issues.
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    HELP_CONNECTIVITY = 188752,
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Showed at EULA screen as "Learn more" about stats/crash reports.
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    HELP_STATS_USAGE = 183078,
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Showed whenever there're troubles signing in (offline case).
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    HELP_CANT_ACCESS_ACCOUNT_OFFLINE = 188755,
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Showed whenever there're troubles signing in (online case).
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    HELP_CANT_ACCESS_ACCOUNT = 188036,
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Showed in case when account was disabled.
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    HELP_ACCOUNT_DISABLED = 188756,
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Showed in case when hosted account is used.
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    HELP_HOSTED_ACCOUNT = 1054228,
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    // Showed as "Learn more" about enterprise enrolled devices.
382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    HELP_ENTERPRISE = 2535613,
39effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch    // Shown at reset screen as "Learn more" about powerwash/rollback options.
40effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch    HELP_POWERWASH = 183084,
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  };
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Parent window is used to show dialog.
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  explicit HelpAppLauncher(gfx::NativeWindow parent_window);
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Shows specified help topic.
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void ShowHelpTopic(HelpTopic help_topic_id);
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) protected:
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual ~HelpAppLauncher();
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  friend class base::RefCountedThreadSafe<HelpAppLauncher>;
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Shows help topic dialog for specified GURL.
56a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  void ShowHelpTopicDialog(Profile* profile, const GURL& topic_url);
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Parent window which is passed to help dialog.
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  gfx::NativeWindow parent_window_;
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(HelpAppLauncher);
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace chromeos
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_
67