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

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

Issue 9310079: Moved app shortcut code out of ExtensionService. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed stupid virtual ommission Created 8 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/extensions/app_shortcut_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_SHORTCUT_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_APP_SHORTCUT_MANAGER_H_
7 #pragma once
8
9 #include "chrome/browser/extensions/image_loading_tracker.h"
10 #include "chrome/browser/shell_integration.h"
11 #include "chrome/common/extensions/extension.h"
12 #include "content/public/browser/notification_observer.h"
13 #include "content/public/browser/notification_registrar.h"
14
15 class Profile;
16
17 // This class manages the installation of shortcuts for platform apps.
18 class AppShortcutManager : public ImageLoadingTracker::Observer,
19 public content::NotificationObserver {
20 public:
21 explicit AppShortcutManager(Profile* profile);
22
23 // Implement ImageLoadingTracker::Observer. |tracker_| is used to
24 // load the application's icon, which is done when we start creating an
25 // application's shortcuts. This method receives the icon, and completes
26 // the process of installing the shortcuts.
27 virtual void OnImageLoaded(SkBitmap* image,
28 const ExtensionResource& resource,
29 int index) OVERRIDE;
30
31 // content::NotificationObserver
32 virtual void Observe(int type,
33 const content::NotificationSource& source,
34 const content::NotificationDetails& details) OVERRIDE;
35
36 static void SetShortcutCreationDisabledForTesting(bool disabled);
37 private:
38 // Install the shortcuts for an application.
39 void InstallApplicationShortcuts(const Extension* extension);
40
41 content::NotificationRegistrar registrar_;
42 Profile* profile_;
43
44 // Fields used when installing application shortcuts.
45 ShellIntegration::ShortcutInfo shortcut_info_;
46 ImageLoadingTracker tracker_;
47
48 DISALLOW_COPY_AND_ASSIGN(AppShortcutManager);
49 };
50
51 #endif // CHROME_BROWSER_EXTENSIONS_APP_SHORTCUT_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/app_shortcut_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698