| OLD | NEW |
| 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 #import "chrome/browser/cocoa/content_blocked_bubble_controller.h" |
| 6 |
| 5 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 6 #include "base/logging.h" | 8 #include "base/logging.h" |
| 7 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 8 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 9 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/blocked_popup_container.h" | 12 #include "chrome/browser/blocked_popup_container.h" |
| 11 #import "chrome/browser/cocoa/content_blocked_bubble_controller.h" | 13 #import "chrome/browser/cocoa/content_settings_dialog_controller.h" |
| 12 #import "chrome/browser/cocoa/hyperlink_button_cell.h" | 14 #import "chrome/browser/cocoa/hyperlink_button_cell.h" |
| 13 #import "chrome/browser/cocoa/info_bubble_view.h" | 15 #import "chrome/browser/cocoa/info_bubble_view.h" |
| 14 #include "chrome/browser/host_content_settings_map.h" | 16 #include "chrome/browser/host_content_settings_map.h" |
| 15 #include "chrome/browser/profile.h" | 17 #include "chrome/browser/profile.h" |
| 16 #include "chrome/browser/tab_contents/tab_contents.h" | 18 #include "chrome/browser/tab_contents/tab_contents.h" |
| 17 #include "chrome/common/notification_service.h" | 19 #include "chrome/common/notification_service.h" |
| 18 #include "chrome/common/notification_type.h" | 20 #include "chrome/common/notification_type.h" |
| 19 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 20 #include "skia/ext/skia_utils_mac.h" | 22 #include "skia/ext/skia_utils_mac.h" |
| 21 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 23 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 profile_->GetHostContentSettingsMap()->SetContentSetting(host_, | 369 profile_->GetHostContentSettingsMap()->SetContentSetting(host_, |
| 368 settingsType_, | 370 settingsType_, |
| 369 setting); | 371 setting); |
| 370 } | 372 } |
| 371 | 373 |
| 372 - (IBAction)closeBubble:(id)sender { | 374 - (IBAction)closeBubble:(id)sender { |
| 373 [self close]; | 375 [self close]; |
| 374 } | 376 } |
| 375 | 377 |
| 376 - (IBAction)manageBlocking:(id)sender { | 378 - (IBAction)manageBlocking:(id)sender { |
| 377 // TODO(thakis): Implement, http://crbug.com/34894 | 379 if (tabContents_) { |
| 378 NOTIMPLEMENTED(); | 380 tabContents_->delegate()->ShowContentSettingsWindow(settingsType_); |
| 381 } else { |
| 382 [ContentSettingsDialogController showContentSettingsForType:settingsType_ |
| 383 profile:profile_]; |
| 384 } |
| 379 } | 385 } |
| 380 | 386 |
| 381 - (void)popupLinkClicked:(id)sender { | 387 - (void)popupLinkClicked:(id)sender { |
| 382 content_blocked_bubble::PopupLinks::iterator i(popupLinks_.find(sender)); | 388 content_blocked_bubble::PopupLinks::iterator i(popupLinks_.find(sender)); |
| 383 DCHECK(i != popupLinks_.end()); | 389 DCHECK(i != popupLinks_.end()); |
| 384 if (tabContents_ && tabContents_->blocked_popup_container()) | 390 if (tabContents_ && tabContents_->blocked_popup_container()) |
| 385 tabContents_->blocked_popup_container()->LaunchPopupForContents(i->second); | 391 tabContents_->blocked_popup_container()->LaunchPopupForContents(i->second); |
| 386 } | 392 } |
| 387 | 393 |
| 388 @end // ContentBlockedBubbleController | 394 @end // ContentBlockedBubbleController |
| OLD | NEW |