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_GUEST_VIEW_BASE_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 static void RegisterGuestViewType(const std::string& view_type, | 63 static void RegisterGuestViewType(const std::string& view_type, |
64 const GuestCreationCallback& callback); | 64 const GuestCreationCallback& callback); |
65 | 65 |
66 static GuestViewBase* Create(content::BrowserContext* browser_context, | 66 static GuestViewBase* Create(content::BrowserContext* browser_context, |
67 content::WebContents* owner_web_contents, | 67 content::WebContents* owner_web_contents, |
68 int guest_instance_id, | 68 int guest_instance_id, |
69 const std::string& view_type); | 69 const std::string& view_type); |
70 | 70 |
71 static GuestViewBase* FromWebContents(content::WebContents* web_contents); | 71 static GuestViewBase* FromWebContents(content::WebContents* web_contents); |
72 | 72 |
73 static GuestViewBase* From(int embedder_process_id, int instance_id); | 73 static GuestViewBase* From(int owner_process_id, int instance_id); |
74 | 74 |
75 static bool IsGuest(content::WebContents* web_contents); | 75 static bool IsGuest(content::WebContents* web_contents); |
76 | 76 |
77 virtual const char* GetViewType() const = 0; | 77 virtual const char* GetViewType() const = 0; |
78 | 78 |
79 // This method is called after the guest has been attached to an embedder and | 79 // This method is called after the guest has been attached to an embedder and |
80 // suspended resource loads have been resumed. | 80 // suspended resource loads have been resumed. |
81 // | 81 // |
82 // This method can be overriden by subclasses. This gives the derived class | 82 // This method can be overriden by subclasses. This gives the derived class |
83 // an opportunity to perform setup actions after attachment. | 83 // an opportunity to perform setup actions after attachment. |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 // This is used to ensure pending tasks will not fire after this object is | 391 // This is used to ensure pending tasks will not fire after this object is |
392 // destroyed. | 392 // destroyed. |
393 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 393 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
394 | 394 |
395 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 395 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
396 }; | 396 }; |
397 | 397 |
398 } // namespace extensions | 398 } // namespace extensions |
399 | 399 |
400 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 400 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
OLD | NEW |