| 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/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 9 #include "chrome/browser/browsing_instance.h" | 9 #include "chrome/browser/browsing_instance.h" |
| 10 #include "chrome/browser/in_process_webkit/dom_storage_context.h" | 10 #include "chrome/browser/in_process_webkit/dom_storage_context.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 const GURL& source_url, | 149 const GURL& source_url, |
| 150 int request_id, | 150 int request_id, |
| 151 bool has_callback) { | 151 bool has_callback) { |
| 152 // TODO(rafaelw): It may make sense for extensions to be able to open | 152 // TODO(rafaelw): It may make sense for extensions to be able to open |
| 153 // BackgroundContents to chrome-extension://<id> pages. Consider implementing. | 153 // BackgroundContents to chrome-extension://<id> pages. Consider implementing. |
| 154 render_view_host_->BlockExtensionRequest(request_id); | 154 render_view_host_->BlockExtensionRequest(request_id); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void BackgroundContents::CreateNewWindow( | 157 void BackgroundContents::CreateNewWindow( |
| 158 int route_id, | 158 int route_id, |
| 159 WindowContainerType window_container_type) { | 159 WindowContainerType window_container_type, |
| 160 const string16& frame_name) { |
| 160 delegate_view_helper_.CreateNewWindow(route_id, | 161 delegate_view_helper_.CreateNewWindow(route_id, |
| 161 render_view_host_->process()->profile(), | 162 render_view_host_->process()->profile(), |
| 162 render_view_host_->site_instance(), | 163 render_view_host_->site_instance(), |
| 163 DOMUIFactory::GetDOMUIType(url_), | 164 DOMUIFactory::GetDOMUIType(url_), |
| 164 this, | 165 this, |
| 165 window_container_type); | 166 window_container_type, |
| 167 frame_name); |
| 166 } | 168 } |
| 167 | 169 |
| 168 void BackgroundContents::CreateNewWidget(int route_id, | 170 void BackgroundContents::CreateNewWidget(int route_id, |
| 169 WebKit::WebPopupType popup_type) { | 171 WebKit::WebPopupType popup_type) { |
| 170 NOTREACHED(); | 172 NOTREACHED(); |
| 171 } | 173 } |
| 172 | 174 |
| 173 void BackgroundContents::ShowCreatedWindow(int route_id, | 175 void BackgroundContents::ShowCreatedWindow(int route_id, |
| 174 WindowOpenDisposition disposition, | 176 WindowOpenDisposition disposition, |
| 175 const gfx::Rect& initial_pos, | 177 const gfx::Rect& initial_pos, |
| 176 bool user_gesture) { | 178 bool user_gesture) { |
| 177 TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id); | 179 TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id); |
| 178 if (!contents) | 180 if (!contents) |
| 179 return; | 181 return; |
| 180 Browser* browser = BrowserList::GetLastActiveWithProfile( | 182 Browser* browser = BrowserList::GetLastActiveWithProfile( |
| 181 render_view_host_->process()->profile()); | 183 render_view_host_->process()->profile()); |
| 182 if (!browser) | 184 if (!browser) |
| 183 return; | 185 return; |
| 184 | 186 |
| 185 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); | 187 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); |
| 186 } | 188 } |
| 187 | 189 |
| 188 void BackgroundContents::ShowCreatedWidget(int route_id, | 190 void BackgroundContents::ShowCreatedWidget(int route_id, |
| 189 const gfx::Rect& initial_pos) { | 191 const gfx::Rect& initial_pos) { |
| 190 NOTIMPLEMENTED(); | 192 NOTIMPLEMENTED(); |
| 191 } | 193 } |
| 192 | 194 |
| OLD | NEW |