| 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_GUEST_VIEW_BASE_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| 6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 6 #define CHROME_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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 static GuestViewBase* Create(content::BrowserContext* browser_context, | 60 static GuestViewBase* Create(content::BrowserContext* browser_context, |
| 61 int guest_instance_id, | 61 int guest_instance_id, |
| 62 const std::string& view_type); | 62 const std::string& view_type); |
| 63 | 63 |
| 64 static GuestViewBase* FromWebContents(content::WebContents* web_contents); | 64 static GuestViewBase* FromWebContents(content::WebContents* web_contents); |
| 65 | 65 |
| 66 static GuestViewBase* From(int embedder_process_id, int instance_id); | 66 static GuestViewBase* From(int embedder_process_id, int instance_id); |
| 67 | 67 |
| 68 static bool IsGuest(content::WebContents* web_contents); | 68 static bool IsGuest(content::WebContents* web_contents); |
| 69 | 69 |
| 70 // By default, JavaScript and images are enabled in guest content. | |
| 71 static void GetDefaultContentSettingRules(RendererContentSettingRules* rules, | |
| 72 bool incognito); | |
| 73 | |
| 74 virtual const char* GetViewType() const = 0; | 70 virtual const char* GetViewType() const = 0; |
| 75 | 71 |
| 76 // This method is called after the guest has been attached to an embedder and | 72 // This method is called after the guest has been attached to an embedder and |
| 77 // suspended resource loads have been resumed. | 73 // suspended resource loads have been resumed. |
| 78 // | 74 // |
| 79 // This method can be overriden by subclasses. This gives the derived class | 75 // This method can be overriden by subclasses. This gives the derived class |
| 80 // an opportunity to perform setup actions after attachment. | 76 // an opportunity to perform setup actions after attachment. |
| 81 virtual void DidAttachToEmbedder() {} | 77 virtual void DidAttachToEmbedder() {} |
| 82 | 78 |
| 83 // This method is called after this GuestViewBase has been initiated. | 79 // This method is called after this GuestViewBase has been initiated. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 gfx::Size min_auto_size_; | 320 gfx::Size min_auto_size_; |
| 325 | 321 |
| 326 // This is used to ensure pending tasks will not fire after this object is | 322 // This is used to ensure pending tasks will not fire after this object is |
| 327 // destroyed. | 323 // destroyed. |
| 328 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 324 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
| 329 | 325 |
| 330 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 326 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
| 331 }; | 327 }; |
| 332 | 328 |
| 333 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 329 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| OLD | NEW |