Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/common/chrome_constants.h" | 9 #include "chrome/common/chrome_constants.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "chrome/common/jstemplate_builder.h" | 11 #include "chrome/common/jstemplate_builder.h" |
| 12 #include "chrome/common/render_messages.h" | 12 #include "chrome/common/render_messages.h" |
| 13 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
| 14 #include "chrome/renderer/blocked_plugin.h" | 14 #include "chrome/renderer/blocked_plugin.h" |
| 15 #include "chrome/renderer/localized_error.h" | 15 #include "chrome/renderer/localized_error.h" |
| 16 #include "chrome/renderer/render_thread.h" | 16 #include "chrome/renderer/render_thread.h" |
| 17 #include "content/common/view_messages.h" | |
| 17 #include "content/renderer/render_view.h" | 18 #include "content/renderer/render_view.h" |
| 18 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 19 #include "grit/locale_settings.h" | 20 #include "grit/locale_settings.h" |
| 20 #include "grit/renderer_resources.h" | 21 #include "grit/renderer_resources.h" |
| 21 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
| 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
| 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" |
| 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 46 | 47 |
| 47 std::string ChromeContentRendererClient::GetDefaultEncoding() { | 48 std::string ChromeContentRendererClient::GetDefaultEncoding() { |
| 48 return l10n_util::GetStringUTF8(IDS_DEFAULT_ENCODING); | 49 return l10n_util::GetStringUTF8(IDS_DEFAULT_ENCODING); |
| 49 } | 50 } |
| 50 | 51 |
| 51 WebPlugin* ChromeContentRendererClient::CreatePlugin( | 52 WebPlugin* ChromeContentRendererClient::CreatePlugin( |
| 52 RenderView* render_view, | 53 RenderView* render_view, |
| 53 WebFrame* frame, | 54 WebFrame* frame, |
| 54 const WebPluginParams& params) { | 55 const WebPluginParams& params) { |
| 55 bool found = false; | 56 bool found = false; |
| 56 ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT; | 57 int plugin_setting = CONTENT_SETTING_DEFAULT; |
|
Tom Sepez
2011/03/23 17:32:53
sizeof(int) != sizeof(enum) if -fshort-enums? Did
jam
2011/03/23 18:21:02
yeah, temporarily since i wanted to move this file
| |
| 57 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 58 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 58 webkit::npapi::WebPluginInfo info; | 59 webkit::npapi::WebPluginInfo info; |
| 59 GURL url(params.url); | 60 GURL url(params.url); |
| 60 std::string actual_mime_type; | 61 std::string actual_mime_type; |
| 61 render_view->Send(new ViewHostMsg_GetPluginInfo( | 62 render_view->Send(new ViewHostMsg_GetPluginInfo( |
| 62 render_view->routing_id(), url, frame->top()->url(), | 63 render_view->routing_id(), url, frame->top()->url(), |
| 63 params.mimeType.utf8(), &found, &info, &plugin_setting, | 64 params.mimeType.utf8(), &found, &info, &plugin_setting, |
| 64 &actual_mime_type)); | 65 &actual_mime_type)); |
| 65 | 66 |
| 66 if (!found) | 67 if (!found) |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 // language code for tradtional Chinese among others. | 222 // language code for tradtional Chinese among others. |
| 222 // |LanguageCodeWithDialect| will go through ISO 639-1, ISO-639-2 and | 223 // |LanguageCodeWithDialect| will go through ISO 639-1, ISO-639-2 and |
| 223 // 'other' tables to do the 'right' thing. In addition, it'll return zh-CN | 224 // 'other' tables to do the 'right' thing. In addition, it'll return zh-CN |
| 224 // for Simplified Chinese. | 225 // for Simplified Chinese. |
| 225 language = LanguageCodeWithDialects(cld_language); | 226 language = LanguageCodeWithDialects(cld_language); |
| 226 } | 227 } |
| 227 return language; | 228 return language; |
| 228 } | 229 } |
| 229 | 230 |
| 230 } // namespace chrome | 231 } // namespace chrome |
| OLD | NEW |