| 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/render_view_host_delegate_helper.h" | 5 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/background_contents_service.h" | 10 #include "chrome/browser/background_contents_service.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 return NULL; | 96 return NULL; |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Create the new web contents. This will automatically create the new | 100 // Create the new web contents. This will automatically create the new |
| 101 // TabContentsView. In the future, we may want to create the view separately. | 101 // TabContentsView. In the future, we may want to create the view separately. |
| 102 TabContents* new_contents = | 102 TabContents* new_contents = |
| 103 new TabContents(profile, | 103 new TabContents(profile, |
| 104 site, | 104 site, |
| 105 route_id, | 105 route_id, |
| 106 opener->GetAsTabContents()); | 106 opener->GetAsTabContents(), |
| 107 NULL); |
| 107 new_contents->set_opener_dom_ui_type(domui_type); | 108 new_contents->set_opener_dom_ui_type(domui_type); |
| 108 TabContentsView* new_view = new_contents->view(); | 109 TabContentsView* new_view = new_contents->view(); |
| 109 | 110 |
| 110 // TODO(brettw) it seems bogus that we have to call this function on the | 111 // TODO(brettw) it seems bogus that we have to call this function on the |
| 111 // newly created object and give it one of its own member variables. | 112 // newly created object and give it one of its own member variables. |
| 112 new_view->CreateViewForWidget(new_contents->render_view_host()); | 113 new_view->CreateViewForWidget(new_contents->render_view_host()); |
| 113 | 114 |
| 114 // Save the created window associated with the route so we can show it later. | 115 // Save the created window associated with the route so we can show it later. |
| 115 pending_contents_[route_id] = new_contents->render_view_host(); | 116 pending_contents_[route_id] = new_contents->render_view_host(); |
| 116 return new_contents; | 117 return new_contents; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 314 } |
| 314 DCHECK(!web_prefs.default_encoding.empty()); | 315 DCHECK(!web_prefs.default_encoding.empty()); |
| 315 | 316 |
| 316 if (is_dom_ui) { | 317 if (is_dom_ui) { |
| 317 web_prefs.loads_images_automatically = true; | 318 web_prefs.loads_images_automatically = true; |
| 318 web_prefs.javascript_enabled = true; | 319 web_prefs.javascript_enabled = true; |
| 319 } | 320 } |
| 320 | 321 |
| 321 return web_prefs; | 322 return web_prefs; |
| 322 } | 323 } |
| OLD | NEW |