Home | History | Annotate | Download | only in login
      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.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_
      6 #define CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_
      7 
      8 #include "base/compiler_specific.h"
      9 #include "base/memory/ref_counted.h"
     10 #include "base/memory/scoped_ptr.h"
     11 #include "chrome/browser/chromeos/login/login_web_dialog.h"
     12 #include "ui/gfx/native_widget_types.h"
     13 
     14 namespace chromeos {
     15 
     16 // Provides help content during OOBE / login.
     17 // Based on connectivity state (offline/online) shows help topic dialog
     18 // or launches HelpApp in BWSI mode.
     19 class HelpAppLauncher : public base::RefCountedThreadSafe<HelpAppLauncher> {
     20  public:
     21   // IDs of help topics available from HelpApp.
     22   enum HelpTopic {
     23     // Showed on basic connectivity issues.
     24     HELP_CONNECTIVITY = 188752,
     25     // Showed at EULA screen as "Learn more" about stats/crash reports.
     26     HELP_STATS_USAGE = 183078,
     27     // Showed whenever there're troubles signing in (offline case).
     28     HELP_CANT_ACCESS_ACCOUNT_OFFLINE = 188755,
     29     // Showed whenever there're troubles signing in (online case).
     30     HELP_CANT_ACCESS_ACCOUNT = 188036,
     31     // Showed in case when account was disabled.
     32     HELP_ACCOUNT_DISABLED = 188756,
     33     // Showed in case when hosted account is used.
     34     HELP_HOSTED_ACCOUNT = 1054228,
     35     // Showed as "Learn more" about enterprise enrolled devices.
     36     HELP_ENTERPRISE = 2535613,
     37   };
     38 
     39   // Parent window is used to show dialog.
     40   explicit HelpAppLauncher(gfx::NativeWindow parent_window);
     41 
     42   // Shows specified help topic.
     43   void ShowHelpTopic(HelpTopic help_topic_id);
     44 
     45  protected:
     46   virtual ~HelpAppLauncher();
     47 
     48  private:
     49   friend class base::RefCountedThreadSafe<HelpAppLauncher>;
     50 
     51   // Shows help topic dialog for specified GURL.
     52   void ShowHelpTopicDialog(const GURL& topic_url);
     53 
     54   // Parent window which is passed to help dialog.
     55   gfx::NativeWindow parent_window_;
     56 
     57   DISALLOW_COPY_AND_ASSIGN(HelpAppLauncher);
     58 };
     59 
     60 }  // namespace chromeos
     61 
     62 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_
     63