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

Side by Side Diff: chrome/browser/extensions/app_shortcut_manager.h

Issue 10824198: Move small c/b/extensions classes into extensions namespace no.1 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest-er master for cq Created 8 years, 4 months 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 #ifndef CHROME_BROWSER_EXTENSIONS_APP_SHORTCUT_MANAGER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_SHORTCUT_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_APP_SHORTCUT_MANAGER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_APP_SHORTCUT_MANAGER_H_
7 7
8 #include "chrome/browser/extensions/image_loading_tracker.h" 8 #include "chrome/browser/extensions/image_loading_tracker.h"
9 #include "chrome/browser/shell_integration.h" 9 #include "chrome/browser/shell_integration.h"
10 #include "chrome/common/extensions/extension.h" 10 #include "chrome/common/extensions/extension.h"
11 #include "content/public/browser/notification_observer.h" 11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h" 12 #include "content/public/browser/notification_registrar.h"
13 13
14 class Profile; 14 class Profile;
15 15
16 namespace extensions {
16 // This class manages the installation of shortcuts for platform apps. 17 // This class manages the installation of shortcuts for platform apps.
17 class AppShortcutManager : public ImageLoadingTracker::Observer, 18 class AppShortcutManager : public ImageLoadingTracker::Observer,
18 public content::NotificationObserver { 19 public content::NotificationObserver {
19 public: 20 public:
20 explicit AppShortcutManager(Profile* profile); 21 explicit AppShortcutManager(Profile* profile);
21 22
22 // Implement ImageLoadingTracker::Observer. |tracker_| is used to 23 // Implement ImageLoadingTracker::Observer. |tracker_| is used to
23 // load the application's icon, which is done when we start creating an 24 // load the application's icon, which is done when we start creating an
24 // application's shortcuts. This method receives the icon, and completes 25 // application's shortcuts. This method receives the icon, and completes
25 // the process of installing the shortcuts. 26 // the process of installing the shortcuts.
26 virtual void OnImageLoaded(const gfx::Image& image, 27 virtual void OnImageLoaded(const gfx::Image& image,
27 const std::string& extension_id, 28 const std::string& extension_id,
28 int index) OVERRIDE; 29 int index) OVERRIDE;
29 30
30 // content::NotificationObserver 31 // content::NotificationObserver
31 virtual void Observe(int type, 32 virtual void Observe(int type,
32 const content::NotificationSource& source, 33 const content::NotificationSource& source,
33 const content::NotificationDetails& details) OVERRIDE; 34 const content::NotificationDetails& details) OVERRIDE;
34 35
35 static void SetShortcutCreationDisabledForTesting(bool disabled); 36 static void SetShortcutCreationDisabledForTesting(bool disabled);
36 private: 37 private:
37 // Install the shortcuts for an application. 38 // Install the shortcuts for an application.
38 void InstallApplicationShortcuts(const extensions::Extension* extension); 39 void InstallApplicationShortcuts(const Extension* extension);
39 void DeleteApplicationShortcuts(const extensions::Extension* extension); 40 void DeleteApplicationShortcuts(const Extension* extension);
40 41
41 content::NotificationRegistrar registrar_; 42 content::NotificationRegistrar registrar_;
42 Profile* profile_; 43 Profile* profile_;
43 44
44 // Fields used when installing application shortcuts. 45 // Fields used when installing application shortcuts.
45 ShellIntegration::ShortcutInfo shortcut_info_; 46 ShellIntegration::ShortcutInfo shortcut_info_;
46 ImageLoadingTracker tracker_; 47 ImageLoadingTracker tracker_;
47 48
48 DISALLOW_COPY_AND_ASSIGN(AppShortcutManager); 49 DISALLOW_COPY_AND_ASSIGN(AppShortcutManager);
49 }; 50 };
51 } // namespace extensions
50 52
51 #endif // CHROME_BROWSER_EXTENSIONS_APP_SHORTCUT_MANAGER_H_ 53 #endif // CHROME_BROWSER_EXTENSIONS_APP_SHORTCUT_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/management/management_browsertest.cc ('k') | chrome/browser/extensions/app_shortcut_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698