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

Side by Side Diff: chrome/browser/blocked_plugin_manager.cc

Issue 2967007: Disable outdated plugins, block non-sandboxed plugins. (Closed)
Patch Set: '' Created 10 years, 5 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
« no previous file with comments | « chrome/browser/blocked_plugin_manager.h ('k') | chrome/browser/plugin_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/blocked_plugin_manager.h"
6
7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h"
9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/renderer_host/render_view_host.h"
11 #include "chrome/browser/tab_contents/tab_contents.h"
12 #include "grit/generated_resources.h"
13 #include "grit/theme_resources.h"
14
15 BlockedPluginManager::BlockedPluginManager(TabContents* tab_contents)
16 : ConfirmInfoBarDelegate(tab_contents),
17 tab_contents_(tab_contents) { }
18
19 void BlockedPluginManager::OnNonSandboxedPluginBlocked(const string16& name) {
20 name_ = name;
21 tab_contents_->AddInfoBar(this);
22 }
23
24 void BlockedPluginManager::OnBlockedPluginLoaded() {
25 tab_contents_->RemoveInfoBar(this);
26 }
27
28 std::wstring BlockedPluginManager::GetButtonLabel(InfoBarButton button) const {
29 if (button == BUTTON_OK)
30 return l10n_util::GetString(IDS_PLUGIN_LOAD);
31 return ConfirmInfoBarDelegate::GetButtonLabel(button);
32 }
33
34 std::wstring BlockedPluginManager::GetMessageText() const {
35 return UTF16ToWide(l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_PROMPT,
36 name_));
37 }
38
39 std::wstring BlockedPluginManager::GetLinkText() {
40 return l10n_util::GetString(IDS_LEARN_MORE);
41 }
42
43 SkBitmap* BlockedPluginManager::GetIcon() const {
44 return ResourceBundle::GetSharedInstance().GetBitmapNamed(
45 IDR_INFOBAR_PLUGIN_INSTALL);
46 }
47
48 bool BlockedPluginManager::Accept() {
49 tab_contents_->render_view_host()->LoadBlockedPlugins();
50 return true;
51 }
52
53 bool BlockedPluginManager::LinkClicked(WindowOpenDisposition disposition) {
54 // TODO(bauerb): Navigate to a help page explaining why we blocked the plugin,
55 // once we have one.
56 return false;
57 }
OLDNEW
« no previous file with comments | « chrome/browser/blocked_plugin_manager.h ('k') | chrome/browser/plugin_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698