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

Side by Side Diff: chrome/browser/ui/webui/extensions/install_extension_handler.h

Issue 10378026: Reland 135525 - Add a first-class off-store install UI to chrome://extensions/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_UI_WEBUI_EXTENSIONS_INSTALL_EXTENSION_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_INSTALL_EXTENSION_HANDLER_H_
7 #pragma once
8
9 #include "base/file_path.h"
10 #include "base/values.h"
11 #include "content/public/browser/web_ui_message_handler.h"
12
13 // Handles installing an extension when its file is dragged onto the page.
14 class InstallExtensionHandler : public content::WebUIMessageHandler {
15 public:
16 InstallExtensionHandler();
17 virtual ~InstallExtensionHandler();
18
19 void GetLocalizedValues(DictionaryValue* localized_strings);
20
21 // WebUIMessageHandler implementation.
22 virtual void RegisterMessages() OVERRIDE;
23
24 private:
25 // Handles a notification from the JavaScript that a drag has started. This is
26 // needed so that we can capture the file being dragged. If we wait until
27 // we receive a drop notification, the drop data in the browser process will
28 // have already been destroyed.
29 void HandleStartDragMessage(const ListValue* args);
30
31 // Handles a notification from the JavaScript that a drag has stopped.
32 void HandleStopDragMessage(const ListValue* args);
33
34 // Handles a notification from the JavaScript to install the file currently
35 // being dragged.
36 //
37 // IMPORTANT: We purposefully do not allow the JavaScript to specify the file
38 // to be installed as a precaution against the extension management page
39 // getting XSS'd.
40 void HandleInstallMessage(const ListValue* args);
41
42 // The extension that will be installed when HandleInstallMessage() is called.
43 FilePath file_to_install_;
44
45 DISALLOW_COPY_AND_ASSIGN(InstallExtensionHandler);
46 };
47
48 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_INSTALL_EXTENSION_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/extensions/extensions_ui.cc ('k') | chrome/browser/ui/webui/extensions/install_extension_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698