OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/apps/shortcut_manager.h" | 5 #include "chrome/browser/apps/shortcut_manager.h" |
6 | 6 |
7 #include "apps/pref_names.h" | 7 #include "apps/pref_names.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 } // namespace | 57 } // namespace |
58 | 58 |
59 AppShortcutManager::AppShortcutManager(Profile* profile) | 59 AppShortcutManager::AppShortcutManager(Profile* profile) |
60 : profile_(profile), | 60 : profile_(profile), |
61 is_profile_info_cache_observer_(false), | 61 is_profile_info_cache_observer_(false), |
62 prefs_(profile->GetPrefs()), | 62 prefs_(profile->GetPrefs()), |
63 weak_factory_(this) { | 63 weak_factory_(this) { |
64 // Use of g_browser_process requires that we are either on the UI thread, or | 64 // Use of g_browser_process requires that we are either on the UI thread, or |
65 // there are no threads initialized (such as in unit tests). | 65 // there are no threads initialized (such as in unit tests). |
66 DCHECK( | 66 DCHECK(!content::BrowserThread::IsThreadInitialized( |
67 !content::BrowserThread::IsWellKnownThread(content::BrowserThread::UI) || | 67 content::BrowserThread::UI) || |
68 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 68 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
69 | 69 |
70 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, | 70 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, |
71 content::Source<Profile>(profile_)); | 71 content::Source<Profile>(profile_)); |
72 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 72 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
73 content::Source<Profile>(profile_)); | 73 content::Source<Profile>(profile_)); |
74 // Wait for extensions to be ready before running OnceOffCreateShortcuts. | 74 // Wait for extensions to be ready before running OnceOffCreateShortcuts. |
75 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, | 75 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, |
76 content::Source<Profile>(profile_)); | 76 content::Source<Profile>(profile_)); |
77 | 77 |
78 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 78 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 *it->get(), profile_, base::Bind(&CreateShortcutsInApplicationsMenu)); | 185 *it->get(), profile_, base::Bind(&CreateShortcutsInApplicationsMenu)); |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 void AppShortcutManager::DeleteApplicationShortcuts( | 189 void AppShortcutManager::DeleteApplicationShortcuts( |
190 const Extension* extension) { | 190 const Extension* extension) { |
191 ShellIntegration::ShortcutInfo delete_info = | 191 ShellIntegration::ShortcutInfo delete_info = |
192 web_app::ShortcutInfoForExtensionAndProfile(extension, profile_); | 192 web_app::ShortcutInfoForExtensionAndProfile(extension, profile_); |
193 web_app::DeleteAllShortcuts(delete_info); | 193 web_app::DeleteAllShortcuts(delete_info); |
194 } | 194 } |
OLD | NEW |