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 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 5 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/chromeos/profiles/profile_helper.h" | |
12 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/browser/extensions/extension_system.h" | 12 #include "chrome/browser/extensions/extension_system.h" |
| 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
17 | 18 |
18 using content::BrowserThread; | 19 using content::BrowserThread; |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 const char kHelpAppFormat[] = | 23 const char kHelpAppFormat[] = |
23 "chrome-extension://honijodknafkokifofgiaalefdiedpko/oobe.html?id=%d"; | 24 "chrome-extension://honijodknafkokifofgiaalefdiedpko/oobe.html?id=%d"; |
24 | 25 |
25 } // namespace | 26 } // namespace |
26 | 27 |
27 namespace chromeos { | 28 namespace chromeos { |
28 | 29 |
29 /////////////////////////////////////////////////////////////////////////////// | 30 /////////////////////////////////////////////////////////////////////////////// |
30 // HelpApp, public: | 31 // HelpApp, public: |
31 | 32 |
32 HelpAppLauncher::HelpAppLauncher(gfx::NativeWindow parent_window) | 33 HelpAppLauncher::HelpAppLauncher(gfx::NativeWindow parent_window) |
33 : parent_window_(parent_window) { | 34 : parent_window_(parent_window) { |
34 } | 35 } |
35 | 36 |
36 void HelpAppLauncher::ShowHelpTopic(HelpTopic help_topic_id) { | 37 void HelpAppLauncher::ShowHelpTopic(HelpTopic help_topic_id) { |
37 Profile* profile = ProfileHelper::GetSigninProfile(); | 38 Profile* profile = ProfileManager::GetDefaultProfile(); |
38 ExtensionService* service = | 39 ExtensionService* service = |
39 extensions::ExtensionSystem::Get(profile)->extension_service(); | 40 extensions::ExtensionSystem::Get(profile)->extension_service(); |
40 | 41 |
41 DCHECK(service); | 42 DCHECK(service); |
42 if (!service) | 43 if (!service) |
43 return; | 44 return; |
44 | 45 |
45 GURL url(base::StringPrintf(kHelpAppFormat, | 46 GURL url(base::StringPrintf(kHelpAppFormat, |
46 static_cast<int>(help_topic_id))); | 47 static_cast<int>(help_topic_id))); |
47 // HelpApp component extension presents only in official builds so we can | 48 // HelpApp component extension presents only in official builds so we can |
(...skipping 16 matching lines...) Expand all Loading... |
64 NULL, | 65 NULL, |
65 parent_window_, | 66 parent_window_, |
66 l10n_util::GetStringUTF16(IDS_LOGIN_OOBE_HELP_DIALOG_TITLE), | 67 l10n_util::GetStringUTF16(IDS_LOGIN_OOBE_HELP_DIALOG_TITLE), |
67 topic_url, | 68 topic_url, |
68 LoginWebDialog::STYLE_BUBBLE); | 69 LoginWebDialog::STYLE_BUBBLE); |
69 dialog->Show(); | 70 dialog->Show(); |
70 // The dialog object will be deleted on dialog close. | 71 // The dialog object will be deleted on dialog close. |
71 } | 72 } |
72 | 73 |
73 } // namespace chromeos | 74 } // namespace chromeos |
OLD | NEW |