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

Side by Side Diff: chrome/browser/extensions/api/file_system/request_file_system_notification.h

Issue 1032313002: Add a notification about auto-granted access to file systems. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
(Empty)
1 // Copyright 2015 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_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATI ON_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATI ON_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/extensions/app_icon_loader.h"
13 #include "ui/message_center/notification_delegate.h"
14
15 class Profile;
16
17 namespace extensions {
18 class Extension;
19 } // namespace extensions
20
21 namespace file_manager {
22 struct VolumeInfo;
23 } // namespace file_manager
24
25 namespace gfx {
26 class Image;
27 class ImageSkia;
28 } // namespace gfx
29
30 namespace message_center {
31 class Notification;
32 } // namespace message_center
33
34 // Shows notifications for the chrome.fileSystem.requestFileSystem() API.
35 class RequestFileSystemNotification
36 : public message_center::NotificationDelegate,
37 public extensions::AppIconLoader::Delegate {
38 public:
39 // Shows a notification about automatically granted access to a file system.
40 static void ShowAutoGrantedNotification(
41 Profile* profile,
42 const extensions::Extension& extension,
43 const file_manager::VolumeInfo& volume_info,
44 bool writable);
45
46 // extensions::AppIconLoader::Delegate overrides:
47 void SetAppImage(const std::string& id, const gfx::ImageSkia& image) override;
48
49 private:
50 scoped_ptr<extensions::AppIconLoader> icon_loader_;
51 scoped_ptr<gfx::Image> extension_icon_;
52 scoped_ptr<message_center::Notification> pending_notification_;
53
54 RequestFileSystemNotification(Profile* profile,
55 const extensions::Extension& extension);
56
57 // Shows the notification. Can be called only once.
58 void Show(scoped_ptr<message_center::Notification> notification);
59
60 ~RequestFileSystemNotification() override;
61
62 DISALLOW_COPY_AND_ASSIGN(RequestFileSystemNotification);
63 };
64
65 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFIC ATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698