OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/tab_contents/background_contents.h" | 5 #include "chrome/browser/tab_contents/background_contents.h" |
6 | 6 |
7 #include "chrome/browser/background_contents_service.h" | 7 #include "chrome/browser/background_contents_service.h" |
8 #include "chrome/browser/browsing_instance.h" | 8 #include "chrome/browser/browsing_instance.h" |
9 #include "chrome/browser/in_process_webkit/dom_storage_context.h" | 9 #include "chrome/browser/in_process_webkit/dom_storage_context.h" |
10 #include "chrome/browser/in_process_webkit/webkit_context.h" | 10 #include "chrome/browser/in_process_webkit/webkit_context.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // Register for our parent profile to shutdown, so we can shut ourselves down | 41 // Register for our parent profile to shutdown, so we can shut ourselves down |
42 // as well (should only be called for OTR profiles, as we should receive | 42 // as well (should only be called for OTR profiles, as we should receive |
43 // APP_TERMINATING before non-OTR profiles are destroyed). | 43 // APP_TERMINATING before non-OTR profiles are destroyed). |
44 registrar_.Add(this, NotificationType::PROFILE_DESTROYED, | 44 registrar_.Add(this, NotificationType::PROFILE_DESTROYED, |
45 Source<Profile>(profile)); | 45 Source<Profile>(profile)); |
46 } | 46 } |
47 | 47 |
48 // Exposed to allow creating mocks. | 48 // Exposed to allow creating mocks. |
49 BackgroundContents::BackgroundContents() | 49 BackgroundContents::BackgroundContents() |
50 : render_view_host_(NULL) { | 50 : delegate_(NULL), |
| 51 render_view_host_(NULL) { |
51 } | 52 } |
52 | 53 |
53 void BackgroundContents::Observe(NotificationType type, | 54 void BackgroundContents::Observe(NotificationType type, |
54 const NotificationSource& source, | 55 const NotificationSource& source, |
55 const NotificationDetails& details) { | 56 const NotificationDetails& details) { |
56 // TODO(rafaelw): Implement pagegroup ref-counting so that non-persistent | 57 // TODO(rafaelw): Implement pagegroup ref-counting so that non-persistent |
57 // background pages are closed when the last referencing frame is closed. | 58 // background pages are closed when the last referencing frame is closed. |
58 switch (type.value) { | 59 switch (type.value) { |
59 case NotificationType::PROFILE_DESTROYED: | 60 case NotificationType::PROFILE_DESTROYED: |
60 case NotificationType::APP_TERMINATING: { | 61 case NotificationType::APP_TERMINATING: { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 195 } |
195 | 196 |
196 void BackgroundContents::ShowCreatedWidget(int route_id, | 197 void BackgroundContents::ShowCreatedWidget(int route_id, |
197 const gfx::Rect& initial_pos) { | 198 const gfx::Rect& initial_pos) { |
198 NOTIMPLEMENTED(); | 199 NOTIMPLEMENTED(); |
199 } | 200 } |
200 | 201 |
201 void BackgroundContents::ShowCreatedFullscreenWidget(int route_id) { | 202 void BackgroundContents::ShowCreatedFullscreenWidget(int route_id) { |
202 NOTIMPLEMENTED(); | 203 NOTIMPLEMENTED(); |
203 } | 204 } |
OLD | NEW |