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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.h

Issue 984963004: <webview>: Implement fullscreen permission for html5 element.requestFullscreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tmptmptmp
Patch Set: Created 5 years, 9 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
OLDNEW
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 <vector> 8 #include <vector>
9 9
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // Sets the transparency of the guest. 84 // Sets the transparency of the guest.
85 void SetAllowTransparency(bool allow); 85 void SetAllowTransparency(bool allow);
86 86
87 // Loads a data URL with a specified base URL and virtual URL. 87 // Loads a data URL with a specified base URL and virtual URL.
88 bool LoadDataWithBaseURL(const std::string& data_url, 88 bool LoadDataWithBaseURL(const std::string& data_url,
89 const std::string& base_url, 89 const std::string& base_url,
90 const std::string& virtual_url, 90 const std::string& virtual_url,
91 std::string* error); 91 std::string* error);
92 92
93 // GuestViewBase implementation. 93 // GuestViewBase implementation.
94 void EmbedderFullscreenToggled(bool entered_fullscreen) override;
94 bool CanRunInDetachedState() const override; 95 bool CanRunInDetachedState() const override;
95 void CreateWebContents(const base::DictionaryValue& create_params, 96 void CreateWebContents(const base::DictionaryValue& create_params,
96 const WebContentsCreatedCallback& callback) override; 97 const WebContentsCreatedCallback& callback) override;
97 void DidAttachToEmbedder() override; 98 void DidAttachToEmbedder() override;
98 void DidDropLink(const GURL& url) override; 99 void DidDropLink(const GURL& url) override;
99 void DidInitialize(const base::DictionaryValue& create_params) override; 100 void DidInitialize(const base::DictionaryValue& create_params) override;
100 void DidStopLoading() override; 101 void DidStopLoading() override;
101 void EmbedderWillBeDestroyed() override; 102 void EmbedderWillBeDestroyed() override;
102 const char* GetAPINamespace() const override; 103 const char* GetAPINamespace() const override;
103 int GetTaskPrefix() const override; 104 int GetTaskPrefix() const override;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 bool user_gesture, 158 bool user_gesture,
158 bool* was_blocked) override; 159 bool* was_blocked) override;
159 content::WebContents* OpenURLFromTab( 160 content::WebContents* OpenURLFromTab(
160 content::WebContents* source, 161 content::WebContents* source,
161 const content::OpenURLParams& params) override; 162 const content::OpenURLParams& params) override;
162 void WebContentsCreated(content::WebContents* source_contents, 163 void WebContentsCreated(content::WebContents* source_contents,
163 int opener_render_frame_id, 164 int opener_render_frame_id,
164 const base::string16& frame_name, 165 const base::string16& frame_name,
165 const GURL& target_url, 166 const GURL& target_url,
166 content::WebContents* new_contents) override; 167 content::WebContents* new_contents) override;
168 void EnterFullscreenModeForTab(content::WebContents* web_contents,
169 const GURL& origin) override;
170 void ExitFullscreenModeForTab(content::WebContents* web_contents) override;
171 bool IsFullscreenForTabOrPending(
172 const content::WebContents* web_contents) const override;
167 173
168 // NotificationObserver implementation. 174 // NotificationObserver implementation.
169 void Observe(int type, 175 void Observe(int type,
170 const content::NotificationSource& source, 176 const content::NotificationSource& source,
171 const content::NotificationDetails& details) override; 177 const content::NotificationDetails& details) override;
172 178
173 // Returns the current zoom factor. 179 // Returns the current zoom factor.
174 double zoom() const { return current_zoom_factor_; } 180 double zoom() const { return current_zoom_factor_; }
175 181
176 // Begin or continue a find request. 182 // Begin or continue a find request.
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // Creates a new guest window owned by this WebViewGuest. 319 // Creates a new guest window owned by this WebViewGuest.
314 void CreateNewGuestWebViewWindow(const content::OpenURLParams& params); 320 void CreateNewGuestWebViewWindow(const content::OpenURLParams& params);
315 321
316 void NewGuestWebViewCallback(const content::OpenURLParams& params, 322 void NewGuestWebViewCallback(const content::OpenURLParams& params,
317 content::WebContents* guest_web_contents); 323 content::WebContents* guest_web_contents);
318 324
319 bool HandleKeyboardShortcuts(const content::NativeWebKeyboardEvent& event); 325 bool HandleKeyboardShortcuts(const content::NativeWebKeyboardEvent& event);
320 326
321 void ApplyAttributes(const base::DictionaryValue& params); 327 void ApplyAttributes(const base::DictionaryValue& params);
322 328
329 void OnFullscreenPermissionDecided(const GURL& origin,
330 bool allowed,
331 const std::string& user_input);
332
323 // Identifies the set of rules registries belonging to this guest. 333 // Identifies the set of rules registries belonging to this guest.
324 int rules_registry_id_; 334 int rules_registry_id_;
325 335
326 // Handles find requests and replies for the webview find API. 336 // Handles find requests and replies for the webview find API.
327 WebViewFindHelper find_helper_; 337 WebViewFindHelper find_helper_;
328 338
329 ObserverList<ScriptExecutionObserver> script_observers_; 339 ObserverList<ScriptExecutionObserver> script_observers_;
330 scoped_ptr<ScriptExecutor> script_executor_; 340 scoped_ptr<ScriptExecutor> script_executor_;
331 341
332 content::NotificationRegistrar notification_registrar_; 342 content::NotificationRegistrar notification_registrar_;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 }; 374 };
365 375
366 using PendingWindowMap = std::map<WebViewGuest*, NewWindowInfo>; 376 using PendingWindowMap = std::map<WebViewGuest*, NewWindowInfo>;
367 PendingWindowMap pending_new_windows_; 377 PendingWindowMap pending_new_windows_;
368 378
369 // Stores the current zoom factor. 379 // Stores the current zoom factor.
370 double current_zoom_factor_; 380 double current_zoom_factor_;
371 381
372 // Determines if this guest accepts pinch-zoom gestures. 382 // Determines if this guest accepts pinch-zoom gestures.
373 bool allow_scaling_; 383 bool allow_scaling_;
384 bool is_fullscreen_;
374 385
375 // 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
376 // destroyed. 387 // destroyed.
377 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; 388 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_;
378 389
379 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); 390 DISALLOW_COPY_AND_ASSIGN(WebViewGuest);
380 }; 391 };
381 392
382 } // namespace extensions 393 } // namespace extensions
383 394
384 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ 395 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698