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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Showed whenever there're troubles signing in (online case). | 31 // Showed whenever there're troubles signing in (online case). |
32 HELP_CANT_ACCESS_ACCOUNT = 188036, | 32 HELP_CANT_ACCESS_ACCOUNT = 188036, |
33 // Showed in case when account was disabled. | 33 // Showed in case when account was disabled. |
34 HELP_ACCOUNT_DISABLED = 188756, | 34 HELP_ACCOUNT_DISABLED = 188756, |
35 // Showed in case when hosted account is used. | 35 // Showed in case when hosted account is used. |
36 HELP_HOSTED_ACCOUNT = 1054228, | 36 HELP_HOSTED_ACCOUNT = 1054228, |
37 }; | 37 }; |
38 | 38 |
39 // Parent window is used to show dialog. | 39 // Parent window is used to show dialog. |
40 explicit HelpAppLauncher(gfx::NativeWindow parent_window); | 40 explicit HelpAppLauncher(gfx::NativeWindow parent_window); |
41 virtual ~HelpAppLauncher(); | |
42 | 41 |
43 // Shows specified help topic. | 42 // Shows specified help topic. |
44 void ShowHelpTopic(HelpTopic help_topic_id); | 43 void ShowHelpTopic(HelpTopic help_topic_id); |
45 | 44 |
46 // Returns true if the dialog is currently open. | 45 // Returns true if the dialog is currently open. |
47 bool is_open() const { return dialog_.get() && dialog_->is_open(); } | 46 bool is_open() const { return dialog_.get() && dialog_->is_open(); } |
48 | 47 |
49 protected: | 48 protected: |
| 49 virtual ~HelpAppLauncher(); |
| 50 |
50 // LoginWebDialog::Delegate implementation: | 51 // LoginWebDialog::Delegate implementation: |
51 virtual void OnDialogClosed() OVERRIDE {} | 52 virtual void OnDialogClosed() OVERRIDE {} |
52 | 53 |
53 private: | 54 private: |
| 55 friend class base::RefCountedThreadSafe<HelpAppLauncher>; |
| 56 |
54 // Shows help topic dialog for specified GURL. | 57 // Shows help topic dialog for specified GURL. |
55 void ShowHelpTopicDialog(const GURL& topic_url); | 58 void ShowHelpTopicDialog(const GURL& topic_url); |
56 | 59 |
57 // Dialog used to display help like "Can't access your account". | 60 // Dialog used to display help like "Can't access your account". |
58 scoped_ptr<LoginWebDialog> dialog_; | 61 scoped_ptr<LoginWebDialog> dialog_; |
59 | 62 |
60 // Parent window which is passed to help dialog. | 63 // Parent window which is passed to help dialog. |
61 gfx::NativeWindow parent_window_; | 64 gfx::NativeWindow parent_window_; |
62 | 65 |
63 DISALLOW_COPY_AND_ASSIGN(HelpAppLauncher); | 66 DISALLOW_COPY_AND_ASSIGN(HelpAppLauncher); |
64 }; | 67 }; |
65 | 68 |
66 } // namespace chromeos | 69 } // namespace chromeos |
67 | 70 |
68 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_ | 71 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELP_APP_LAUNCHER_H_ |
OLD | NEW |