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/blocked_plugin.h" | 5 #include "chrome/renderer/blocked_plugin.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 int resource_id = IDR_BLOCKED_PLUGIN_HTML; | 43 int resource_id = IDR_BLOCKED_PLUGIN_HTML; |
44 const base::StringPiece template_html( | 44 const base::StringPiece template_html( |
45 ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id)); | 45 ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id)); |
46 | 46 |
47 DCHECK(!template_html.empty()) << "unable to load template. ID: " | 47 DCHECK(!template_html.empty()) << "unable to load template. ID: " |
48 << resource_id; | 48 << resource_id; |
49 | 49 |
50 DictionaryValue localized_strings; | 50 DictionaryValue localized_strings; |
51 localized_strings.SetString(L"loadPlugin", | 51 localized_strings.SetString(L"loadPlugin", |
52 l10n_util::GetString(IDS_PLUGIN_LOAD)); | 52 l10n_util::GetString(IDS_PLUGIN_LOAD)); |
| 53 localized_strings.SetString(L"message", |
| 54 l10n_util::GetString(IDS_BLOCKED_PLUGINS_TITLE)); |
53 | 55 |
54 // "t" is the id of the templates root node. | 56 // "t" is the id of the templates root node. |
55 std::string htmlData = jstemplate_builder::GetTemplatesHtml( | 57 std::string htmlData = jstemplate_builder::GetTemplatesHtml( |
56 template_html, &localized_strings, "t"); | 58 template_html, &localized_strings, "t"); |
57 | 59 |
58 web_view->mainFrame()->loadHTMLString(htmlData, | 60 web_view->mainFrame()->loadHTMLString(htmlData, |
59 GURL(kBlockedPluginDataURL)); | 61 GURL(kBlockedPluginDataURL)); |
60 } | 62 } |
61 | 63 |
62 void BlockedPlugin::BindWebFrame(WebFrame* frame) { | 64 void BlockedPlugin::BindWebFrame(WebFrame* frame) { |
(...skipping 17 matching lines...) Expand all Loading... |
80 plugin_params_, | 82 plugin_params_, |
81 std::string(), | 83 std::string(), |
82 FilePath()); | 84 FilePath()); |
83 if (new_plugin && new_plugin->initialize(container)) { | 85 if (new_plugin && new_plugin->initialize(container)) { |
84 container->setPlugin(new_plugin); | 86 container->setPlugin(new_plugin); |
85 container->invalidate(); | 87 container->invalidate(); |
86 container->reportGeometry(); | 88 container->reportGeometry(); |
87 plugin_->destroy(); | 89 plugin_->destroy(); |
88 } | 90 } |
89 } | 91 } |
OLD | NEW |