| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_RENDERER_STATE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // Looks up the information for the embedder <webview> for a given render | 37 // Looks up the information for the embedder <webview> for a given render |
| 38 // view, if one exists. Called on the IO thread. | 38 // view, if one exists. Called on the IO thread. |
| 39 bool GetWebViewInfo(int guest_process_id, int guest_routing_id, | 39 bool GetWebViewInfo(int guest_process_id, int guest_routing_id, |
| 40 WebViewInfo* webview_info); | 40 WebViewInfo* webview_info); |
| 41 | 41 |
| 42 // Looks up the tab and window ID for a given render view. Returns true | 42 // Looks up the tab and window ID for a given render view. Returns true |
| 43 // if we have the IDs in our map. Called on the IO thread. | 43 // if we have the IDs in our map. Called on the IO thread. |
| 44 bool GetTabAndWindowId( | 44 bool GetTabAndWindowId( |
| 45 int render_process_host_id, int routing_id, int* tab_id, int* window_id); | 45 int render_process_host_id, int routing_id, int* tab_id, int* window_id); |
| 46 | 46 |
| 47 // Returns true if the given renderer is used by webviews. |
| 48 bool IsWebViewRenderer(int render_process_id); |
| 49 |
| 47 private: | 50 private: |
| 48 class RenderViewHostObserver; | 51 class RenderViewHostObserver; |
| 49 class TabObserver; | 52 class TabObserver; |
| 50 friend class TabObserver; | 53 friend class TabObserver; |
| 51 friend class WebViewGuest; | 54 friend class WebViewGuest; |
| 52 friend struct DefaultSingletonTraits<ExtensionRendererState>; | 55 friend struct DefaultSingletonTraits<ExtensionRendererState>; |
| 53 | 56 |
| 54 typedef std::pair<int, int> RenderId; | 57 typedef std::pair<int, int> RenderId; |
| 55 typedef std::pair<int, int> TabAndWindowId; | 58 typedef std::pair<int, int> TabAndWindowId; |
| 56 typedef std::map<RenderId, TabAndWindowId> TabAndWindowIdMap; | 59 typedef std::map<RenderId, TabAndWindowId> TabAndWindowIdMap; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 71 void RemoveWebView(int render_process_host_id, int routing_id); | 74 void RemoveWebView(int render_process_host_id, int routing_id); |
| 72 | 75 |
| 73 TabObserver* observer_; | 76 TabObserver* observer_; |
| 74 TabAndWindowIdMap map_; | 77 TabAndWindowIdMap map_; |
| 75 WebViewInfoMap webview_info_map_; | 78 WebViewInfoMap webview_info_map_; |
| 76 | 79 |
| 77 DISALLOW_COPY_AND_ASSIGN(ExtensionRendererState); | 80 DISALLOW_COPY_AND_ASSIGN(ExtensionRendererState); |
| 78 }; | 81 }; |
| 79 | 82 |
| 80 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ | 83 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ |
| OLD | NEW |