Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/chromeos/login/help_app_launcher.cc

Issue 11365181: Remove GetExtensionService from Profile. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: replace missing extension_system include Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/extensions/extension_service.h" 11 #include "chrome/browser/extensions/extension_service.h"
12 #include "chrome/browser/extensions/extension_system.h"
12 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/profiles/profile_manager.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 = ProfileManager::GetDefaultProfile(); 38 Profile* profile = ProfileManager::GetDefaultProfile();
38 ExtensionService* service = profile->GetExtensionService(); 39 ExtensionService* service =
40 extensions::ExtensionSystem::Get(profile)->extension_service();
39 41
40 DCHECK(service); 42 DCHECK(service);
41 if (!service) 43 if (!service)
42 return; 44 return;
43 45
44 GURL url(base::StringPrintf(kHelpAppFormat, 46 GURL url(base::StringPrintf(kHelpAppFormat,
45 static_cast<int>(help_topic_id))); 47 static_cast<int>(help_topic_id)));
46 // HelpApp component extension presents only in official builds so we can 48 // HelpApp component extension presents only in official builds so we can
47 // show help only when the extensions is installed. 49 // show help only when the extensions is installed.
48 if (service->extensions()->GetByID(url.host())) 50 if (service->extensions()->GetByID(url.host()))
(...skipping 14 matching lines...) Expand all
63 this, 65 this,
64 parent_window_, 66 parent_window_,
65 l10n_util::GetStringUTF16(IDS_LOGIN_OOBE_HELP_DIALOG_TITLE), 67 l10n_util::GetStringUTF16(IDS_LOGIN_OOBE_HELP_DIALOG_TITLE),
66 topic_url, 68 topic_url,
67 LoginWebDialog::STYLE_BUBBLE); 69 LoginWebDialog::STYLE_BUBBLE);
68 dialog->Show(); 70 dialog->Show();
69 // The dialog object will be deleted on dialog close. 71 // The dialog object will be deleted on dialog close.
70 } 72 }
71 73
72 } // namespace chromeos 74 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc ('k') | chrome/browser/chromeos/login/login_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698