| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "base/macros.h" | 10 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 13 #include "chrome/browser/chromeos/login/ui/login_web_dialog.h" | |
| 14 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 15 | 13 |
| 14 class GURL; |
| 16 class Profile; | 15 class Profile; |
| 17 | 16 |
| 18 namespace chromeos { | 17 namespace chromeos { |
| 19 | 18 |
| 20 // Provides help content during OOBE / login. | 19 // Provides help content during OOBE / login. |
| 21 // Based on connectivity state (offline/online) shows help topic dialog | 20 // Based on connectivity state (offline/online) shows help topic dialog |
| 22 // or launches HelpApp in BWSI mode. | 21 // or launches HelpApp in BWSI mode. |
| 23 class HelpAppLauncher : public base::RefCountedThreadSafe<HelpAppLauncher> { | 22 class HelpAppLauncher : public base::RefCountedThreadSafe<HelpAppLauncher> { |
| 24 public: | 23 public: |
| 25 // IDs of help topics available from HelpApp. | 24 // IDs of help topics available from HelpApp. |
| 26 enum HelpTopic { | 25 enum HelpTopic { |
| 27 // Showed at EULA screen as "Learn more" about stats/crash reports. | 26 // Showed at EULA screen as "Learn more" about stats/crash reports. |
| 28 HELP_STATS_USAGE = 183078, | 27 HELP_STATS_USAGE = 183078, |
| 29 // Showed whenever there're troubles signing in. | 28 // Showed whenever there're troubles signing in. |
| 30 HELP_CANT_ACCESS_ACCOUNT = 188036, | 29 HELP_CANT_ACCESS_ACCOUNT = 188036, |
| 31 // Showed in case when account was disabled. | 30 // Showed in case when account was disabled. |
| 32 HELP_ACCOUNT_DISABLED = 188756, | 31 HELP_ACCOUNT_DISABLED = 188756, |
| 33 // Showed as "Learn more" about enterprise enrolled devices. | 32 // Showed as "Learn more" about enterprise enrolled devices. |
| 34 HELP_ENTERPRISE = 2535613, | 33 HELP_ENTERPRISE = 2535613, |
| 35 // Shown at reset screen as "Learn more" about powerwash/rollback options. | 34 // Shown at reset screen as "Learn more" about powerwash/rollback options. |
| 36 HELP_POWERWASH = 183084, | 35 HELP_POWERWASH = 183084, |
| 37 // Shown as "Learn more" about the device attributes. | 36 // Shown as "Learn more" about the device attributes. |
| 38 HELP_DEVICE_ATTRIBUTES = 6218780, | 37 HELP_DEVICE_ATTRIBUTES = 6218780, |
| 39 }; | 38 }; |
| 40 | 39 |
| 41 // Parent window is used to show dialog. | 40 // The dialog is shown as a child of |parent_window|. If |parent_window| is |
| 41 // null then the dialog is placed in the modal dialog container on the primary |
| 42 // display. |
| 42 explicit HelpAppLauncher(gfx::NativeWindow parent_window); | 43 explicit HelpAppLauncher(gfx::NativeWindow parent_window); |
| 43 | 44 |
| 44 // Shows specified help topic. | 45 // Shows specified help topic. |
| 45 void ShowHelpTopic(HelpTopic help_topic_id); | 46 void ShowHelpTopic(HelpTopic help_topic_id); |
| 46 | 47 |
| 47 protected: | 48 protected: |
| 48 virtual ~HelpAppLauncher(); | 49 virtual ~HelpAppLauncher(); |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 friend class base::RefCountedThreadSafe<HelpAppLauncher>; | 52 friend class base::RefCountedThreadSafe<HelpAppLauncher>; |
| 52 | 53 |
| 53 // Shows help topic dialog for specified GURL. | 54 // Shows help topic dialog for specified GURL. |
| 54 void ShowHelpTopicDialog(Profile* profile, const GURL& topic_url); | 55 void ShowHelpTopicDialog(Profile* profile, const GURL& topic_url); |
| 55 | 56 |
| 56 // Parent window which is passed to help dialog. | 57 // Parent window which is passed to help dialog. |
| 57 gfx::NativeWindow parent_window_; | 58 gfx::NativeWindow parent_window_; |
| 58 | 59 |
| 59 DISALLOW_COPY_AND_ASSIGN(HelpAppLauncher); | 60 DISALLOW_COPY_AND_ASSIGN(HelpAppLauncher); |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 } // namespace chromeos | 63 } // namespace chromeos |
| 63 | 64 |
| 64 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_ | 65 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_ |
| OLD | NEW |