Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: chrome/renderer/blocked_plugin.cc

Issue 3074021: Prettify blocked plugin HTML UI (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698