Chromium Code Reviews| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 490 ContentSettingPluginBubbleModel::~ContentSettingPluginBubbleModel() { | 490 ContentSettingPluginBubbleModel::~ContentSettingPluginBubbleModel() { |
| 491 if (settings_changed()) { | 491 if (settings_changed()) { |
| 492 // If the user elected to allow all plugins then run plugins at this time. | 492 // If the user elected to allow all plugins then run plugins at this time. |
| 493 if (selected_item() == kAllowButtonIndex) | 493 if (selected_item() == kAllowButtonIndex) |
| 494 OnCustomLinkClicked(); | 494 OnCustomLinkClicked(); |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 | 497 |
| 498 void ContentSettingPluginBubbleModel::OnCustomLinkClicked() { | 498 void ContentSettingPluginBubbleModel::OnCustomLinkClicked() { |
| 499 content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); | 499 content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); |
| 500 DCHECK(web_contents()); | 500 if (!web_contents()) |
|
markusheintz_
2014/12/12 09:43:09
Please add a comment above this line that explains
| |
| 501 return; | |
| 501 #if defined(ENABLE_PLUGINS) | 502 #if defined(ENABLE_PLUGINS) |
| 502 // TODO(bauerb): We should send the identifiers of blocked plug-ins here. | 503 // TODO(bauerb): We should send the identifiers of blocked plug-ins here. |
| 503 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( | 504 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( |
| 504 web_contents(), true, std::string()); | 505 web_contents(), true, std::string()); |
| 505 #endif | 506 #endif |
| 506 set_custom_link_enabled(false); | 507 set_custom_link_enabled(false); |
| 507 TabSpecificContentSettings::FromWebContents(web_contents())-> | 508 TabSpecificContentSettings::FromWebContents(web_contents())-> |
| 508 set_load_plugins_link_enabled(false); | 509 set_load_plugins_link_enabled(false); |
| 509 } | 510 } |
| 510 | 511 |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1294 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1295 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
| 1295 DCHECK_EQ(web_contents_, | 1296 DCHECK_EQ(web_contents_, |
| 1296 content::Source<WebContents>(source).ptr()); | 1297 content::Source<WebContents>(source).ptr()); |
| 1297 web_contents_ = NULL; | 1298 web_contents_ = NULL; |
| 1298 } else { | 1299 } else { |
| 1299 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 1300 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
| 1300 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 1301 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
| 1301 profile_ = NULL; | 1302 profile_ = NULL; |
| 1302 } | 1303 } |
| 1303 } | 1304 } |
| OLD | NEW |