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

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: Fixed. Created 5 years, 8 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 "base/memory/weak_ptr.h"
13 #include "chrome/browser/extensions/app_icon_loader.h"
14 #include "ui/message_center/notification_delegate.h"
15
16 class Profile;
17
18 namespace extensions {
19 class Extension;
20 } // namespace extensions
21
22 namespace file_manager {
23 class Volume;
24 } // namespace file_manager
25
26 namespace gfx {
27 class Image;
28 class ImageSkia;
29 } // namespace gfx
30
31 namespace message_center {
32 class Notification;
33 } // namespace message_center
34
35 // Shows notifications for the chrome.fileSystem.requestFileSystem() API.
36 class RequestFileSystemNotification
37 : public message_center::NotificationDelegate,
38 public extensions::AppIconLoader::Delegate {
39 public:
40 // Shows a notification about automatically granted access to a file system.
41 static void ShowAutoGrantedNotification(
42 Profile* profile,
43 const extensions::Extension& extension,
44 const base::WeakPtr<file_manager::Volume>& volume,
45 bool writable);
46
47 private:
48 RequestFileSystemNotification(Profile* profile,
49 const extensions::Extension& extension);
50 ~RequestFileSystemNotification() override;
51
52 // Shows the notification. Can be called only once.
53 void Show(scoped_ptr<message_center::Notification> notification);
54
55 // extensions::AppIconLoader::Delegate overrides:
56 void SetAppImage(const std::string& id, const gfx::ImageSkia& image) override;
57
58 scoped_ptr<extensions::AppIconLoader> icon_loader_;
59 scoped_ptr<gfx::Image> extension_icon_;
60 scoped_ptr<message_center::Notification> pending_notification_;
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