| 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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 url, | 223 url, |
| 224 url, | 224 url, |
| 225 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, | 225 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| 226 std::string())); | 226 std::string())); |
| 227 | 227 |
| 228 // Removing an |InfoBarDelegate| from the |InfoBarService| does not delete | 228 // Removing an |InfoBarDelegate| from the |InfoBarService| does not delete |
| 229 // it. Hence the |delegate| must be cleaned up after it was removed from the | 229 // it. Hence the |delegate| must be cleaned up after it was removed from the |
| 230 // |infobar_service|. | 230 // |infobar_service|. |
| 231 InfoBarService* infobar_service = | 231 InfoBarService* infobar_service = |
| 232 InfoBarService::FromWebContents(web_contents()); | 232 InfoBarService::FromWebContents(web_contents()); |
| 233 scoped_ptr<InfoBarDelegate> delegate( | 233 scoped_ptr<InfoBarDelegate> delegate(infobar_service->infobar_at(0)); |
| 234 infobar_service->GetInfoBarDelegateAt(0)); | |
| 235 infobar_service->RemoveInfoBar(delegate.get()); | 234 infobar_service->RemoveInfoBar(delegate.get()); |
| 236 } | 235 } |
| 237 | 236 |
| 238 TEST_F(ContentSettingBubbleModelTest, Plugins) { | 237 TEST_F(ContentSettingBubbleModelTest, Plugins) { |
| 239 TabSpecificContentSettings* content_settings = | 238 TabSpecificContentSettings* content_settings = |
| 240 TabSpecificContentSettings::FromWebContents(web_contents()); | 239 TabSpecificContentSettings::FromWebContents(web_contents()); |
| 241 content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS, | 240 content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS, |
| 242 std::string()); | 241 std::string()); |
| 243 | 242 |
| 244 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model( | 243 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model( |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 ProtocolHandler handler = registry.GetHandlerFor("mailto"); | 525 ProtocolHandler handler = registry.GetHandlerFor("mailto"); |
| 527 ASSERT_FALSE(handler.IsEmpty()); | 526 ASSERT_FALSE(handler.IsEmpty()); |
| 528 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title()); | 527 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title()); |
| 529 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 528 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 530 content_settings->pending_protocol_handler_setting()); | 529 content_settings->pending_protocol_handler_setting()); |
| 531 EXPECT_FALSE(registry.IsIgnored(test_handler)); | 530 EXPECT_FALSE(registry.IsIgnored(test_handler)); |
| 532 } | 531 } |
| 533 | 532 |
| 534 registry.Shutdown(); | 533 registry.Shutdown(); |
| 535 } | 534 } |
| OLD | NEW |