| 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 EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
| 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 12 #include "base/macros.h" |
| 10 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 11 #include "components/guest_view/browser/guest_view.h" | 14 #include "components/guest_view/browser/guest_view.h" |
| 12 #include "content/public/browser/javascript_dialog_manager.h" | 15 #include "content/public/browser/javascript_dialog_manager.h" |
| 13 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 14 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 15 #include "extensions/browser/guest_view/web_view/javascript_dialog_helper.h" | 18 #include "extensions/browser/guest_view/web_view/javascript_dialog_helper.h" |
| 16 #include "extensions/browser/guest_view/web_view/web_view_find_helper.h" | 19 #include "extensions/browser/guest_view/web_view/web_view_find_helper.h" |
| 17 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" | 20 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" |
| 18 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" | 21 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" |
| 19 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" | 22 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 void Stop(); | 140 void Stop(); |
| 138 | 141 |
| 139 // Kill the guest process. | 142 // Kill the guest process. |
| 140 void Terminate(); | 143 void Terminate(); |
| 141 | 144 |
| 142 // Clears data in the storage partition of this guest. | 145 // Clears data in the storage partition of this guest. |
| 143 // | 146 // |
| 144 // Partition data that are newer than |removal_since| will be removed. | 147 // Partition data that are newer than |removal_since| will be removed. |
| 145 // |removal_mask| corresponds to bitmask in StoragePartition::RemoveDataMask. | 148 // |removal_mask| corresponds to bitmask in StoragePartition::RemoveDataMask. |
| 146 bool ClearData(const base::Time remove_since, | 149 bool ClearData(const base::Time remove_since, |
| 147 uint32 removal_mask, | 150 uint32_t removal_mask, |
| 148 const base::Closure& callback); | 151 const base::Closure& callback); |
| 149 | 152 |
| 150 ScriptExecutor* script_executor() { return script_executor_.get(); } | 153 ScriptExecutor* script_executor() { return script_executor_.get(); } |
| 151 | 154 |
| 152 private: | 155 private: |
| 153 friend class WebViewPermissionHelper; | 156 friend class WebViewPermissionHelper; |
| 154 | 157 |
| 155 explicit WebViewGuest(content::WebContents* owner_web_contents); | 158 explicit WebViewGuest(content::WebContents* owner_web_contents); |
| 156 | 159 |
| 157 ~WebViewGuest() override; | 160 ~WebViewGuest() override; |
| 158 | 161 |
| 159 void ClearDataInternal(const base::Time remove_since, | 162 void ClearDataInternal(const base::Time remove_since, |
| 160 uint32 removal_mask, | 163 uint32_t removal_mask, |
| 161 const base::Closure& callback); | 164 const base::Closure& callback); |
| 162 | 165 |
| 163 void OnWebViewNewWindowResponse(int new_window_instance_id, | 166 void OnWebViewNewWindowResponse(int new_window_instance_id, |
| 164 bool allow, | 167 bool allow, |
| 165 const std::string& user_input); | 168 const std::string& user_input); |
| 166 | 169 |
| 167 void OnFullscreenPermissionDecided(bool allowed, | 170 void OnFullscreenPermissionDecided(bool allowed, |
| 168 const std::string& user_input); | 171 const std::string& user_input); |
| 169 bool GuestMadeEmbedderFullscreen() const; | 172 bool GuestMadeEmbedderFullscreen() const; |
| 170 void SetFullscreenState(bool is_fullscreen); | 173 void SetFullscreenState(bool is_fullscreen); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 198 void WillAttachToEmbedder() final; | 201 void WillAttachToEmbedder() final; |
| 199 void WillDestroy() final; | 202 void WillDestroy() final; |
| 200 | 203 |
| 201 // NotificationObserver implementation. | 204 // NotificationObserver implementation. |
| 202 void Observe(int type, | 205 void Observe(int type, |
| 203 const content::NotificationSource& source, | 206 const content::NotificationSource& source, |
| 204 const content::NotificationDetails& details) final; | 207 const content::NotificationDetails& details) final; |
| 205 | 208 |
| 206 // WebContentsDelegate implementation. | 209 // WebContentsDelegate implementation. |
| 207 bool AddMessageToConsole(content::WebContents* source, | 210 bool AddMessageToConsole(content::WebContents* source, |
| 208 int32 level, | 211 int32_t level, |
| 209 const base::string16& message, | 212 const base::string16& message, |
| 210 int32 line_no, | 213 int32_t line_no, |
| 211 const base::string16& source_id) final; | 214 const base::string16& source_id) final; |
| 212 void CloseContents(content::WebContents* source) final; | 215 void CloseContents(content::WebContents* source) final; |
| 213 bool HandleContextMenu(const content::ContextMenuParams& params) final; | 216 bool HandleContextMenu(const content::ContextMenuParams& params) final; |
| 214 void HandleKeyboardEvent(content::WebContents* source, | 217 void HandleKeyboardEvent(content::WebContents* source, |
| 215 const content::NativeWebKeyboardEvent& event) final; | 218 const content::NativeWebKeyboardEvent& event) final; |
| 216 void LoadProgressChanged(content::WebContents* source, double progress) final; | 219 void LoadProgressChanged(content::WebContents* source, double progress) final; |
| 217 bool PreHandleGestureEvent(content::WebContents* source, | 220 bool PreHandleGestureEvent(content::WebContents* source, |
| 218 const blink::WebGestureEvent& event) final; | 221 const blink::WebGestureEvent& event) final; |
| 219 void RendererResponsive(content::WebContents* source) final; | 222 void RendererResponsive(content::WebContents* source) final; |
| 220 void RendererUnresponsive(content::WebContents* source) final; | 223 void RendererUnresponsive(content::WebContents* source) final; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // This is used to ensure pending tasks will not fire after this object is | 386 // This is used to ensure pending tasks will not fire after this object is |
| 384 // destroyed. | 387 // destroyed. |
| 385 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; | 388 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; |
| 386 | 389 |
| 387 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 390 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
| 388 }; | 391 }; |
| 389 | 392 |
| 390 } // namespace extensions | 393 } // namespace extensions |
| 391 | 394 |
| 392 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 395 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
| OLD | NEW |