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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_H_
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"
18 namespace extensions
{
20 } // namespace extensions
22 namespace file_manager
{
24 } // namespace file_manager
31 namespace message_center
{
33 } // namespace message_center
35 // Shows notifications for the chrome.fileSystem.requestFileSystem() API.
36 class RequestFileSystemNotification
37 : public message_center::NotificationDelegate
,
38 public extensions::AppIconLoader::Delegate
{
40 // Shows a notification about automatically granted access to a file system.
41 static void ShowAutoGrantedNotification(
43 const extensions::Extension
& extension
,
44 const base::WeakPtr
<file_manager::Volume
>& volume
,
48 RequestFileSystemNotification(Profile
* profile
,
49 const extensions::Extension
& extension
);
50 ~RequestFileSystemNotification() override
;
52 // Shows the notification. Can be called only once.
53 void Show(scoped_ptr
<message_center::Notification
> notification
);
55 // extensions::AppIconLoader::Delegate overrides:
56 void SetAppImage(const std::string
& id
, const gfx::ImageSkia
& image
) override
;
58 scoped_ptr
<extensions::AppIconLoader
> icon_loader_
;
59 scoped_ptr
<gfx::Image
> extension_icon_
;
60 scoped_ptr
<message_center::Notification
> pending_notification_
;
62 DISALLOW_COPY_AND_ASSIGN(RequestFileSystemNotification
);
65 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_H_