Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 // extensions::AppIconLoader::Delegate overrides: | |
| 48 void SetAppImage(const std::string& id, const gfx::ImageSkia& image) override; | |
|
benwells
2015/04/07 08:31:33
Nit: this can be private
mtomasz
2015/04/08 00:30:46
Done.
| |
| 49 | |
| 50 private: | |
| 51 RequestFileSystemNotification(Profile* profile, | |
| 52 const extensions::Extension& extension); | |
| 53 ~RequestFileSystemNotification() override; | |
| 54 | |
| 55 // Shows the notification. Can be called only once. | |
| 56 void Show(scoped_ptr<message_center::Notification> notification); | |
| 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_ | |
| OLD | NEW |