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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 web_view->mainFrame()->setCanHaveScrollbars(false); | 42 web_view->mainFrame()->setCanHaveScrollbars(false); |
43 | 43 |
44 int resource_id = IDR_BLOCKED_PLUGIN_HTML; | 44 int resource_id = IDR_BLOCKED_PLUGIN_HTML; |
45 const base::StringPiece template_html( | 45 const base::StringPiece template_html( |
46 ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id)); | 46 ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id)); |
47 | 47 |
48 DCHECK(!template_html.empty()) << "unable to load template. ID: " | 48 DCHECK(!template_html.empty()) << "unable to load template. ID: " |
49 << resource_id; | 49 << resource_id; |
50 | 50 |
51 DictionaryValue localized_strings; | 51 DictionaryValue localized_strings; |
52 localized_strings.SetStringFromUTF16("loadPlugin", | 52 localized_strings.SetString("loadPlugin", |
53 l10n_util::GetStringUTF16(IDS_PLUGIN_LOAD)); | 53 l10n_util::GetStringUTF16(IDS_PLUGIN_LOAD)); |
54 | 54 |
55 // "t" is the id of the templates root node. | 55 // "t" is the id of the templates root node. |
56 std::string htmlData = jstemplate_builder::GetTemplatesHtml( | 56 std::string htmlData = jstemplate_builder::GetTemplatesHtml( |
57 template_html, &localized_strings, "t"); | 57 template_html, &localized_strings, "t"); |
58 | 58 |
59 web_view->mainFrame()->loadHTMLString(htmlData, | 59 web_view->mainFrame()->loadHTMLString(htmlData, |
60 GURL(kBlockedPluginDataURL)); | 60 GURL(kBlockedPluginDataURL)); |
61 | 61 |
62 registrar_.Add(this, | 62 registrar_.Add(this, |
63 NotificationType::SHOULD_LOAD_PLUGINS, | 63 NotificationType::SHOULD_LOAD_PLUGINS, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 NULL, | 96 NULL, |
97 std::string()); | 97 std::string()); |
98 if (new_plugin && new_plugin->initialize(container)) { | 98 if (new_plugin && new_plugin->initialize(container)) { |
99 container->setPlugin(new_plugin); | 99 container->setPlugin(new_plugin); |
100 plugin_->ReplayReceivedData(new_plugin); | 100 plugin_->ReplayReceivedData(new_plugin); |
101 container->invalidate(); | 101 container->invalidate(); |
102 container->reportGeometry(); | 102 container->reportGeometry(); |
103 plugin_->destroy(); | 103 plugin_->destroy(); |
104 } | 104 } |
105 } | 105 } |
OLD | NEW |