| 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/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 3152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3163 int num_languages = 0; | 3163 int num_languages = 0; |
| 3164 bool is_reliable = false; | 3164 bool is_reliable = false; |
| 3165 string16 input = WideToUTF16(text); | 3165 string16 input = WideToUTF16(text); |
| 3166 Language cld_language = | 3166 Language cld_language = |
| 3167 DetectLanguageOfUnicodeText(NULL, input.c_str(), true, &is_reliable, | 3167 DetectLanguageOfUnicodeText(NULL, input.c_str(), true, &is_reliable, |
| 3168 &num_languages, NULL); | 3168 &num_languages, NULL); |
| 3169 if (cld_language != NUM_LANGUAGES && cld_language != UNKNOWN_LANGUAGE && | 3169 if (cld_language != NUM_LANGUAGES && cld_language != UNKNOWN_LANGUAGE && |
| 3170 cld_language != TG_UNKNOWN_LANGUAGE) { | 3170 cld_language != TG_UNKNOWN_LANGUAGE) { |
| 3171 // We should not use LanguageCode_ISO_639_1 because it does not cover all | 3171 // We should not use LanguageCode_ISO_639_1 because it does not cover all |
| 3172 // the languages CLD can detect. As a result, it'll return the invalid | 3172 // the languages CLD can detect. As a result, it'll return the invalid |
| 3173 // language code for tradtional Chinese among others. |LanguageCode| will go | 3173 // language code for tradtional Chinese among others. |
| 3174 // through ISO 639-1, ISO-639-2 and 'other' tables to do the 'right' thing. | 3174 // |LanguageCodeWithDialect| will go through ISO 639-1, ISO-639-2 and |
| 3175 language = LanguageCode(cld_language); | 3175 // 'other' tables to do the 'right' thing. In addition, it'll return zh-CN |
| 3176 // for Simplified Chinese. |
| 3177 language = LanguageCodeWithDialects(cld_language); |
| 3176 } | 3178 } |
| 3177 return language; | 3179 return language; |
| 3178 } | 3180 } |
| 3179 | 3181 |
| 3180 bool RenderView::allowContentType(ContentSettingsType settings_type, | 3182 bool RenderView::allowContentType(ContentSettingsType settings_type, |
| 3181 bool enabled_per_settings) { | 3183 bool enabled_per_settings) { |
| 3182 if (!enabled_per_settings) | 3184 if (!enabled_per_settings) |
| 3183 return false; | 3185 return false; |
| 3184 // CONTENT_SETTING_ASK is only valid for cookies. | 3186 // CONTENT_SETTING_ASK is only valid for cookies. |
| 3185 if (current_content_settings_.settings[settings_type] == CONTENT_SETTING_BLOCK | 3187 if (current_content_settings_.settings[settings_type] == CONTENT_SETTING_BLOCK |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4270 int32 height, | 4272 int32 height, |
| 4271 uint64 io_surface_identifier) { | 4273 uint64 io_surface_identifier) { |
| 4272 Send(new ViewHostMsg_GPUPluginSetIOSurface( | 4274 Send(new ViewHostMsg_GPUPluginSetIOSurface( |
| 4273 routing_id(), window, width, height, io_surface_identifier)); | 4275 routing_id(), window, width, height, io_surface_identifier)); |
| 4274 } | 4276 } |
| 4275 | 4277 |
| 4276 void RenderView::GPUPluginBuffersSwapped(gfx::PluginWindowHandle window) { | 4278 void RenderView::GPUPluginBuffersSwapped(gfx::PluginWindowHandle window) { |
| 4277 Send(new ViewHostMsg_GPUPluginBuffersSwapped(routing_id(), window)); | 4279 Send(new ViewHostMsg_GPUPluginBuffersSwapped(routing_id(), window)); |
| 4278 } | 4280 } |
| 4279 #endif | 4281 #endif |
| 4280 | |
| OLD | NEW |