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

Side by Side Diff: chrome/browser/extensions/extension_popup_api.h

Issue 385061: experimental.popup support for tab-content-viewed extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_POPUP_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_POPUP_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_POPUP_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_POPUP_API_H_
7 7
8 #include "chrome/browser/extensions/extension_function.h" 8 #include "chrome/browser/extensions/extension_function.h"
9 #include "chrome/common/notification_registrar.h" 9 #include "chrome/common/notification_registrar.h"
10 10
11 namespace gfx {
12 class Point;
13 } // namespace gfx
14
11 class Profile; 15 class Profile;
12 class ExtensionPopup; 16 class ExtensionPopup;
13 17
14 // This extension function shows a pop-up extension view. It is asynchronous 18 // This extension function shows a pop-up extension view. It is asynchronous
15 // because the callback must be invoked only after the associated render 19 // because the callback must be invoked only after the associated render
16 // process/view has been created and fully initialized. 20 // process/view has been created and fully initialized.
17 class PopupShowFunction : public AsyncExtensionFunction, 21 class PopupShowFunction : public AsyncExtensionFunction,
18 public NotificationObserver { 22 public NotificationObserver {
19 public: 23 public:
20 PopupShowFunction(); 24 PopupShowFunction();
21 25
22 virtual void Run(); 26 virtual void Run();
23 virtual bool RunImpl(); 27 virtual bool RunImpl();
24 DECLARE_EXTENSION_FUNCTION_NAME("experimental.popup.show") 28 DECLARE_EXTENSION_FUNCTION_NAME("experimental.popup.show")
25 29
26 private: 30 private:
31 // Computes the screen-space position of the frame-relative point in the
32 // extension view that is requesting to display a popup.
33 bool ConvertHostPointToScreen(gfx::Point* point);
34
27 // NotificationObserver methods. 35 // NotificationObserver methods.
28 virtual void Observe(NotificationType type, 36 virtual void Observe(NotificationType type,
29 const NotificationSource& source, 37 const NotificationSource& source,
30 const NotificationDetails& details); 38 const NotificationDetails& details);
31 NotificationRegistrar registrar_; 39 NotificationRegistrar registrar_;
32 40
33 #if defined(TOOLKIT_VIEWS) 41 #if defined(TOOLKIT_VIEWS)
34 // The pop-up view created by this function, saved for access during 42 // The pop-up view created by this function, saved for access during
35 // event notification. The pop-up is not owned by the PopupShowFunction 43 // event notification. The pop-up is not owned by the PopupShowFunction
36 // instance. 44 // instance.
37 ExtensionPopup* popup_; 45 ExtensionPopup* popup_;
38 #endif 46 #endif
39 }; 47 };
40 48
41 // Event router class for events related to the chrome.popup.* set of APIs. 49 // Event router class for events related to the chrome.popup.* set of APIs.
42 class PopupEventRouter { 50 class PopupEventRouter {
43 public: 51 public:
44 static void OnPopupClosed(Profile* profile, 52 static void OnPopupClosed(Profile* profile,
45 int routing_id); 53 int routing_id);
46 private: 54 private:
47 DISALLOW_COPY_AND_ASSIGN(PopupEventRouter); 55 DISALLOW_COPY_AND_ASSIGN(PopupEventRouter);
48 }; 56 };
49 57
50 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_POPUP_API_H_ 58 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_POPUP_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/extensions/extension_popup_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698