| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 // If this is a popup, we must wait for the CreatingNew_ACK message before | 282 // If this is a popup, we must wait for the CreatingNew_ACK message before |
| 283 // completing initialization. Otherwise, we can finish it now. | 283 // completing initialization. Otherwise, we can finish it now. |
| 284 if (opener_id == MSG_ROUTING_NONE) { | 284 if (opener_id == MSG_ROUTING_NONE) { |
| 285 did_show_ = true; | 285 did_show_ = true; |
| 286 CompleteInit(parent_hwnd); | 286 CompleteInit(parent_hwnd); |
| 287 } | 287 } |
| 288 | 288 |
| 289 host_window_ = parent_hwnd; | 289 host_window_ = parent_hwnd; |
| 290 modal_dialog_event_.reset(modal_dialog_event); | 290 modal_dialog_event_.reset(modal_dialog_event); |
| 291 | 291 |
| 292 CommandLine command_line; | 292 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 293 enable_dom_automation_ = | 293 enable_dom_automation_ = |
| 294 command_line.HasSwitch(switches::kDomAutomationController); | 294 command_line.HasSwitch(switches::kDomAutomationController); |
| 295 disable_popup_blocking_ = | 295 disable_popup_blocking_ = |
| 296 command_line.HasSwitch(switches::kDisablePopupBlocking); | 296 command_line.HasSwitch(switches::kDisablePopupBlocking); |
| 297 user_scripts_enabled_ = | 297 user_scripts_enabled_ = |
| 298 command_line.HasSwitch(switches::kEnableUserScripts); | 298 command_line.HasSwitch(switches::kEnableUserScripts); |
| 299 | 299 |
| 300 debug_message_handler_ = new DebugMessageHandler(this); | 300 debug_message_handler_ = new DebugMessageHandler(this); |
| 301 render_thread_->AddFilter(debug_message_handler_); | 301 render_thread_->AddFilter(debug_message_handler_); |
| 302 } | 302 } |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 return widget->webwidget(); | 1827 return widget->webwidget(); |
| 1828 } | 1828 } |
| 1829 | 1829 |
| 1830 static bool ShouldLoadPluginInProcess(const std::string& mime_type, | 1830 static bool ShouldLoadPluginInProcess(const std::string& mime_type, |
| 1831 bool* is_gears) { | 1831 bool* is_gears) { |
| 1832 if (RenderProcess::ShouldLoadPluginsInProcess()) | 1832 if (RenderProcess::ShouldLoadPluginsInProcess()) |
| 1833 return true; | 1833 return true; |
| 1834 | 1834 |
| 1835 if (mime_type == "application/x-googlegears") { | 1835 if (mime_type == "application/x-googlegears") { |
| 1836 *is_gears = true; | 1836 *is_gears = true; |
| 1837 CommandLine cmd; | 1837 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 1838 return cmd.HasSwitch(switches::kGearsInRenderer); | 1838 switches::kGearsInRenderer); |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 return false; | 1841 return false; |
| 1842 } | 1842 } |
| 1843 | 1843 |
| 1844 WebPluginDelegate* RenderView::CreatePluginDelegate( | 1844 WebPluginDelegate* RenderView::CreatePluginDelegate( |
| 1845 WebView* webview, | 1845 WebView* webview, |
| 1846 const GURL& url, | 1846 const GURL& url, |
| 1847 const std::string& mime_type, | 1847 const std::string& mime_type, |
| 1848 const std::string& clsid, | 1848 const std::string& clsid, |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2771 template_resource_id)); | 2771 template_resource_id)); |
| 2772 | 2772 |
| 2773 if (template_html.empty()) { | 2773 if (template_html.empty()) { |
| 2774 NOTREACHED() << "unable to load template. ID: " << template_resource_id; | 2774 NOTREACHED() << "unable to load template. ID: " << template_resource_id; |
| 2775 return ""; | 2775 return ""; |
| 2776 } | 2776 } |
| 2777 // "t" is the id of the templates root node. | 2777 // "t" is the id of the templates root node. |
| 2778 return jstemplate_builder::GetTemplateHtml( | 2778 return jstemplate_builder::GetTemplateHtml( |
| 2779 template_html, &error_strings, "t"); | 2779 template_html, &error_strings, "t"); |
| 2780 } | 2780 } |
| OLD | NEW |