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

Unified 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: Strings committed separately. Rebased. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/file_system/request_file_system_notification.h
diff --git a/chrome/browser/extensions/api/file_system/request_file_system_notification.h b/chrome/browser/extensions/api/file_system/request_file_system_notification.h
new file mode 100644
index 0000000000000000000000000000000000000000..f8f41af019e28c633c7487b899892b638db337ba
--- /dev/null
+++ b/chrome/browser/extensions/api/file_system/request_file_system_notification.h
@@ -0,0 +1,65 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_H_
+#define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/extensions/app_icon_loader.h"
+#include "ui/message_center/notification_delegate.h"
+
+class Profile;
+
+namespace extensions {
+class Extension;
+} // namespace extensions
+
+namespace file_manager {
+class Volume;
+} // namespace file_manager
+
+namespace gfx {
+class Image;
+class ImageSkia;
+} // namespace gfx
+
+namespace message_center {
+class Notification;
+} // namespace message_center
+
+// Shows notifications for the chrome.fileSystem.requestFileSystem() API.
+class RequestFileSystemNotification
+ : public message_center::NotificationDelegate,
+ public extensions::AppIconLoader::Delegate {
+ public:
+ // Shows a notification about automatically granted access to a file system.
+ static void ShowAutoGrantedNotification(
+ Profile* profile,
+ const extensions::Extension& extension,
+ const base::WeakPtr<file_manager::Volume>& volume,
+ bool writable);
+
+ // extensions::AppIconLoader::Delegate overrides:
+ 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.
+
+ private:
+ RequestFileSystemNotification(Profile* profile,
+ const extensions::Extension& extension);
+ ~RequestFileSystemNotification() override;
+
+ // Shows the notification. Can be called only once.
+ void Show(scoped_ptr<message_center::Notification> notification);
+
+ scoped_ptr<extensions::AppIconLoader> icon_loader_;
+ scoped_ptr<gfx::Image> extension_icon_;
+ scoped_ptr<message_center::Notification> pending_notification_;
+
+ DISALLOW_COPY_AND_ASSIGN(RequestFileSystemNotification);
+};
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_H_

Powered by Google App Engine
This is Rietveld 408576698