| OLD | NEW |
| 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 #include "chrome/browser/tab_contents/background_contents.h" | 5 #include "chrome/browser/tab_contents/background_contents.h" |
| 6 | 6 |
| 7 #include "chrome/browser/background/background_contents_service.h" | 7 #include "chrome/browser/background/background_contents_service.h" |
| 8 #include "chrome/browser/extensions/api/messaging/message_service.h" | 8 #include "chrome/browser/extensions/api/messaging/message_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/renderer_preferences_util.h" | 10 #include "chrome/browser/renderer_preferences_util.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED, | 91 chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED, |
| 92 content::Source<Profile>(profile_), | 92 content::Source<Profile>(profile_), |
| 93 content::Details<BackgroundContents>(this)); | 93 content::Details<BackgroundContents>(this)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 // Forward requests to add a new WebContents to our delegate. | 96 // Forward requests to add a new WebContents to our delegate. |
| 97 void BackgroundContents::AddNewContents(WebContents* source, | 97 void BackgroundContents::AddNewContents(WebContents* source, |
| 98 WebContents* new_contents, | 98 WebContents* new_contents, |
| 99 WindowOpenDisposition disposition, | 99 WindowOpenDisposition disposition, |
| 100 const gfx::Rect& initial_pos, | 100 const gfx::Rect& initial_pos, |
| 101 bool user_gesture) { | 101 bool user_gesture, |
| 102 bool* was_blocked) { |
| 102 delegate_->AddWebContents( | 103 delegate_->AddWebContents( |
| 103 new_contents, disposition, initial_pos, user_gesture); | 104 new_contents, disposition, initial_pos, user_gesture, was_blocked); |
| 104 } | 105 } |
| 105 | 106 |
| 106 void BackgroundContents::RenderViewGone(base::TerminationStatus status) { | 107 void BackgroundContents::RenderViewGone(base::TerminationStatus status) { |
| 107 content::NotificationService::current()->Notify( | 108 content::NotificationService::current()->Notify( |
| 108 chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED, | 109 chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED, |
| 109 content::Source<Profile>(profile_), | 110 content::Source<Profile>(profile_), |
| 110 content::Details<BackgroundContents>(this)); | 111 content::Details<BackgroundContents>(this)); |
| 111 | 112 |
| 112 // Our RenderView went away, so we should go away also, so killing the process | 113 // Our RenderView went away, so we should go away also, so killing the process |
| 113 // via the TaskManager doesn't permanently leave a BackgroundContents hanging | 114 // via the TaskManager doesn't permanently leave a BackgroundContents hanging |
| (...skipping 11 matching lines...) Expand all Loading... |
| 125 case chrome::NOTIFICATION_PROFILE_DESTROYED: | 126 case chrome::NOTIFICATION_PROFILE_DESTROYED: |
| 126 case content::NOTIFICATION_APP_TERMINATING: { | 127 case content::NOTIFICATION_APP_TERMINATING: { |
| 127 delete this; | 128 delete this; |
| 128 break; | 129 break; |
| 129 } | 130 } |
| 130 default: | 131 default: |
| 131 NOTREACHED() << "Unexpected notification sent."; | 132 NOTREACHED() << "Unexpected notification sent."; |
| 132 break; | 133 break; |
| 133 } | 134 } |
| 134 } | 135 } |
| OLD | NEW |