| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_GUEST_VIEW_WEB_VIEW_WEB_VIEW_PERMISSION_HELPER_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_PERMISSION_HELPER_H_ |
| 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_PERMISSION_HELPER_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_PERMISSION_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
| 10 #include "chrome/browser/guest_view/web_view/web_view_permission_types.h" | 10 #include "chrome/browser/guest_view/web_view/web_view_permission_types.h" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 13 #include "content/public/common/media_stream_request.h" | 13 #include "content/public/common/media_stream_request.h" |
| 14 #include "extensions/browser/guest_view/guest_view_constants.h" | 14 #include "extensions/browser/guest_view/guest_view_constants.h" |
| 15 | 15 |
| 16 using base::UserMetricsAction; | 16 using base::UserMetricsAction; |
| 17 | 17 |
| 18 namespace extensions { |
| 19 |
| 18 class WebViewGuest; | 20 class WebViewGuest; |
| 19 | 21 |
| 20 // WebViewPermissionHelper manages <webview> permission requests. This helper | 22 // WebViewPermissionHelper manages <webview> permission requests. This helper |
| 21 // class is owned by WebViewGuest. Its purpose is to request permission for | 23 // class is owned by WebViewGuest. Its purpose is to request permission for |
| 22 // various operations from the <webview> embedder, and reply back via callbacks | 24 // various operations from the <webview> embedder, and reply back via callbacks |
| 23 // to the callers on a response from the embedder. | 25 // to the callers on a response from the embedder. |
| 24 class WebViewPermissionHelper | 26 class WebViewPermissionHelper |
| 25 : public content::WebContentsObserver { | 27 : public content::WebContentsObserver { |
| 26 public: | 28 public: |
| 27 explicit WebViewPermissionHelper(WebViewGuest* guest); | 29 explicit WebViewPermissionHelper(WebViewGuest* guest); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 206 |
| 205 std::map<int, int> bridge_id_to_request_id_map_; | 207 std::map<int, int> bridge_id_to_request_id_map_; |
| 206 | 208 |
| 207 WebViewGuest* web_view_guest_; | 209 WebViewGuest* web_view_guest_; |
| 208 | 210 |
| 209 base::WeakPtrFactory<WebViewPermissionHelper> weak_factory_; | 211 base::WeakPtrFactory<WebViewPermissionHelper> weak_factory_; |
| 210 | 212 |
| 211 DISALLOW_COPY_AND_ASSIGN(WebViewPermissionHelper); | 213 DISALLOW_COPY_AND_ASSIGN(WebViewPermissionHelper); |
| 212 }; | 214 }; |
| 213 | 215 |
| 216 } // namespace extensions |
| 217 |
| 214 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_PERMISSION_HELPER_H_ | 218 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_PERMISSION_HELPER_H_ |
| OLD | NEW |