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

Side by Side Diff: content/public/browser/web_contents_delegate.h

Issue 10828356: Very basic Android browser-side compositing support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ifdef Attach/RemoveLayer API Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 namespace history { 51 namespace history {
52 class HistoryAddPageArgs; 52 class HistoryAddPageArgs;
53 } 53 }
54 54
55 namespace webkit_glue { 55 namespace webkit_glue {
56 struct WebIntentData; 56 struct WebIntentData;
57 struct WebIntentServiceData; 57 struct WebIntentServiceData;
58 } 58 }
59 59
60 #if defined(OS_ANDROID)
jam 2012/09/04 16:44:48 ditto
61 namespace WebKit {
62 class WebLayer;
63 }
64 #endif
65
60 namespace content { 66 namespace content {
61 67
62 struct OpenURLParams; 68 struct OpenURLParams;
63 69
64 typedef base::Callback< void(const MediaStreamDevices&) > MediaResponseCallback; 70 typedef base::Callback< void(const MediaStreamDevices&) > MediaResponseCallback;
65 71
66 // Objects implement this interface to get notified about changes in the 72 // Objects implement this interface to get notified about changes in the
67 // WebContents and to provide necessary functionality. 73 // WebContents and to provide necessary functionality.
68 class CONTENT_EXPORT WebContentsDelegate { 74 class CONTENT_EXPORT WebContentsDelegate {
69 public: 75 public:
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 // typically happens when popups are created. 306 // typically happens when popups are created.
301 virtual void WebContentsCreated(WebContents* source_contents, 307 virtual void WebContentsCreated(WebContents* source_contents,
302 int64 source_frame_id, 308 int64 source_frame_id,
303 const GURL& target_url, 309 const GURL& target_url,
304 WebContents* new_contents) {} 310 WebContents* new_contents) {}
305 311
306 // Notifies the delegate that the content restrictions for this tab has 312 // Notifies the delegate that the content restrictions for this tab has
307 // changed. 313 // changed.
308 virtual void ContentRestrictionsChanged(WebContents* source) {} 314 virtual void ContentRestrictionsChanged(WebContents* source) {}
309 315
310 #if defined(OS_ANDROID)
311 // Returns true if the delegate wants to handle the url instead. Default
312 // returns false.
313 virtual bool ShouldOverrideLoading(const GURL& url);
314 #endif
315
316 // Notification that the tab is hung. 316 // Notification that the tab is hung.
317 virtual void RendererUnresponsive(WebContents* source) {} 317 virtual void RendererUnresponsive(WebContents* source) {}
318 318
319 // Notification that the tab is no longer hung. 319 // Notification that the tab is no longer hung.
320 virtual void RendererResponsive(WebContents* source) {} 320 virtual void RendererResponsive(WebContents* source) {}
321 321
322 // Notification that a worker associated with this tab has crashed. 322 // Notification that a worker associated with this tab has crashed.
323 virtual void WorkerCrashed(WebContents* source) {} 323 virtual void WorkerCrashed(WebContents* source) {}
324 324
325 // Invoked when a main fram navigation occurs. 325 // Invoked when a main fram navigation occurs.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // Asks permission to use the camera and/or microphone. If permission is 421 // Asks permission to use the camera and/or microphone. If permission is
422 // granted, a call should be made to |callback| with the devices. If the 422 // granted, a call should be made to |callback| with the devices. If the
423 // request is denied, a call should be made to |callback| with an empty list 423 // request is denied, a call should be made to |callback| with an empty list
424 // of devices. |request| has the details of the request (e.g. which of audio 424 // of devices. |request| has the details of the request (e.g. which of audio
425 // and/or video devices are requested, and lists of available devices). 425 // and/or video devices are requested, and lists of available devices).
426 virtual void RequestMediaAccessPermission( 426 virtual void RequestMediaAccessPermission(
427 WebContents* web_contents, 427 WebContents* web_contents,
428 const MediaStreamRequest* request, 428 const MediaStreamRequest* request,
429 const MediaResponseCallback& callback) {} 429 const MediaResponseCallback& callback) {}
430 430
431 #if defined(OS_ANDROID)
432 // Returns true if the delegate wants to handle the url instead. Default
433 // returns false.
434 virtual bool ShouldOverrideLoading(const GURL& url);
435 virtual void AttachLayer(WebContents* web_contents,
jam 2012/09/04 16:44:48 nit: document these methods
436 WebKit::WebLayer* layer) {}
437 virtual void RemoveLayer(WebContents* web_contents,
438 WebKit::WebLayer* layer) {}
439 #endif
440
431 protected: 441 protected:
432 virtual ~WebContentsDelegate(); 442 virtual ~WebContentsDelegate();
433 443
434 private: 444 private:
435 friend class ::WebContentsImpl; 445 friend class ::WebContentsImpl;
436 446
437 // Called when |this| becomes the WebContentsDelegate for |source|. 447 // Called when |this| becomes the WebContentsDelegate for |source|.
438 void Attach(WebContents* source); 448 void Attach(WebContents* source);
439 449
440 // Called when |this| is no longer the WebContentsDelegate for |source|. 450 // Called when |this| is no longer the WebContentsDelegate for |source|.
441 void Detach(WebContents* source); 451 void Detach(WebContents* source);
442 452
443 // The WebContents that this is currently a delegate for. 453 // The WebContents that this is currently a delegate for.
444 std::set<WebContents*> attached_contents_; 454 std::set<WebContents*> attached_contents_;
445 }; 455 };
446 456
447 } // namespace content 457 } // namespace content
448 458
449 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ 459 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698