OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/ui/content_settings/content_setting_bubble_model.h" | 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 if (settings_changed()) { | 458 if (settings_changed()) { |
459 // If the user elected to allow all plugins then run plugins at this time. | 459 // If the user elected to allow all plugins then run plugins at this time. |
460 if (selected_item() == kAllowButtonIndex) | 460 if (selected_item() == kAllowButtonIndex) |
461 OnCustomLinkClicked(); | 461 OnCustomLinkClicked(); |
462 } | 462 } |
463 } | 463 } |
464 | 464 |
465 void ContentSettingPluginBubbleModel::OnCustomLinkClicked() { | 465 void ContentSettingPluginBubbleModel::OnCustomLinkClicked() { |
466 content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); | 466 content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); |
467 DCHECK(web_contents()); | 467 DCHECK(web_contents()); |
468 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | |
469 #if defined(ENABLE_PLUGINS) | 468 #if defined(ENABLE_PLUGINS) |
| 469 // TODO(bauerb): We should send the identifiers of blocked plug-ins here. |
470 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( | 470 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( |
471 host->GetProcess()->GetID()); | 471 web_contents(), true, std::string()); |
472 #endif | 472 #endif |
473 // TODO(bauerb): We should send the identifiers of blocked plug-ins here. | |
474 host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->GetRoutingID(), | |
475 std::string())); | |
476 set_custom_link_enabled(false); | 473 set_custom_link_enabled(false); |
477 TabSpecificContentSettings::FromWebContents(web_contents())-> | 474 TabSpecificContentSettings::FromWebContents(web_contents())-> |
478 set_load_plugins_link_enabled(false); | 475 set_load_plugins_link_enabled(false); |
479 } | 476 } |
480 | 477 |
481 class ContentSettingPopupBubbleModel : public ContentSettingSingleRadioGroup { | 478 class ContentSettingPopupBubbleModel : public ContentSettingSingleRadioGroup { |
482 public: | 479 public: |
483 ContentSettingPopupBubbleModel(Delegate* delegate, | 480 ContentSettingPopupBubbleModel(Delegate* delegate, |
484 WebContents* web_contents, | 481 WebContents* web_contents, |
485 Profile* profile, | 482 Profile* profile, |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1297 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
1301 DCHECK_EQ(web_contents_, | 1298 DCHECK_EQ(web_contents_, |
1302 content::Source<WebContents>(source).ptr()); | 1299 content::Source<WebContents>(source).ptr()); |
1303 web_contents_ = NULL; | 1300 web_contents_ = NULL; |
1304 } else { | 1301 } else { |
1305 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 1302 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
1306 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 1303 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
1307 profile_ = NULL; | 1304 profile_ = NULL; |
1308 } | 1305 } |
1309 } | 1306 } |
OLD | NEW |