OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
13 #include "content/public/browser/web_contents_delegate.h" | 13 #include "content/public/browser/web_contents_delegate.h" |
14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
15 #include "ui/base/window_open_disposition.h" | 15 #include "ui/base/window_open_disposition.h" |
16 | 16 |
17 class Profile; | 17 class Profile; |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class SessionStorageNamespace; | 20 class SessionStorageNamespace; |
21 class SiteInstance; | 21 class SiteInstance; |
22 }; | 22 }; |
23 | 23 |
24 // This class consumes WebContents. It can host a renderer, but does not | 24 // This class maintains a WebContents used in the background. It can host a |
25 // have any visible display. | 25 // renderer, but does not have any visible display. |
| 26 // TODO(atwilson): Unify this with background pages; http://crbug.com/77790 |
26 class BackgroundContents : public content::WebContentsDelegate, | 27 class BackgroundContents : public content::WebContentsDelegate, |
27 public content::WebContentsObserver, | 28 public content::WebContentsObserver, |
28 public content::NotificationObserver { | 29 public content::NotificationObserver { |
29 public: | 30 public: |
30 class Delegate { | 31 class Delegate { |
31 public: | 32 public: |
32 // Called by AddNewContents(). Asks the delegate to attach the opened | 33 // Called by AddNewContents(). Asks the delegate to attach the opened |
33 // WebContents to a suitable container (e.g. browser) or to show it if it's | 34 // WebContents to a suitable container (e.g. browser) or to show it if it's |
34 // a popup window. If |was_blocked| is non-NULL, then |*was_blocked| will be | 35 // a popup window. If |was_blocked| is non-NULL, then |*was_blocked| will be |
35 // set to true if the popup gets blocked, and left unchanged otherwise. | 36 // set to true if the popup gets blocked, and left unchanged otherwise. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // The BackgroundContents object that has just been opened. | 96 // The BackgroundContents object that has just been opened. |
96 BackgroundContents* contents; | 97 BackgroundContents* contents; |
97 | 98 |
98 // The name of the parent frame for these contents. | 99 // The name of the parent frame for these contents. |
99 const base::string16& frame_name; | 100 const base::string16& frame_name; |
100 | 101 |
101 // The ID of the parent application (if any). | 102 // The ID of the parent application (if any). |
102 const base::string16& application_id; | 103 const base::string16& application_id; |
103 }; | 104 }; |
104 | 105 |
105 #endif // CHROME_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_ | 106 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_H_ |
OLD | NEW |