| 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" | 5 #import "chrome/browser/cocoa/content_blocked_bubble_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/blocked_popup_container.h" | 10 #include "chrome/browser/blocked_popup_container.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 scoped_ptr<ContentSettingBubbleModel> model(contentSettingBubbleModel); | 110 scoped_ptr<ContentSettingBubbleModel> model(contentSettingBubbleModel); |
| 111 DCHECK(model.get()); | 111 DCHECK(model.get()); |
| 112 | 112 |
| 113 NSString* const nibPaths[] = { | 113 NSString* const nibPaths[] = { |
| 114 @"ContentBlockedCookies", | 114 @"ContentBlockedCookies", |
| 115 @"ContentBlockedImages", | 115 @"ContentBlockedImages", |
| 116 @"ContentBlockedJavaScript", | 116 @"ContentBlockedJavaScript", |
| 117 @"ContentBlockedPlugins", | 117 @"ContentBlockedPlugins", |
| 118 @"ContentBlockedPopups", | 118 @"ContentBlockedPopups", |
| 119 @"ContentBubbleGeolocation", | 119 @"ContentBubbleGeolocation", |
| 120 @"", // Notifications do not have a bubble. |
| 120 }; | 121 }; |
| 121 COMPILE_ASSERT(arraysize(nibPaths) == CONTENT_SETTINGS_NUM_TYPES, | 122 COMPILE_ASSERT(arraysize(nibPaths) == CONTENT_SETTINGS_NUM_TYPES, |
| 122 nibPaths_requires_an_entry_for_every_setting_type); | 123 nibPaths_requires_an_entry_for_every_setting_type); |
| 123 const int settingsType = model->content_type(); | 124 const int settingsType = model->content_type(); |
| 125 // Nofifications do not have a bubble. |
| 126 CHECK_NE(settingsType, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); |
| 124 DCHECK_LT(settingsType, CONTENT_SETTINGS_NUM_TYPES); | 127 DCHECK_LT(settingsType, CONTENT_SETTINGS_NUM_TYPES); |
| 125 if ((self = [super initWithWindowNibPath:nibPaths[settingsType] | 128 if ((self = [super initWithWindowNibPath:nibPaths[settingsType] |
| 126 parentWindow:parentWindow | 129 parentWindow:parentWindow |
| 127 anchoredAt:anchoredAt])) { | 130 anchoredAt:anchoredAt])) { |
| 128 contentSettingBubbleModel_.reset(model.release()); | 131 contentSettingBubbleModel_.reset(model.release()); |
| 129 [self showWindow:nil]; | 132 [self showWindow:nil]; |
| 130 } | 133 } |
| 131 return self; | 134 return self; |
| 132 } | 135 } |
| 133 | 136 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 DCHECK(i != popupLinks_.end()); | 398 DCHECK(i != popupLinks_.end()); |
| 396 contentSettingBubbleModel_->OnPopupClicked(i->second); | 399 contentSettingBubbleModel_->OnPopupClicked(i->second); |
| 397 } | 400 } |
| 398 | 401 |
| 399 - (void)clearGeolocationForCurrentHost:(id)sender { | 402 - (void)clearGeolocationForCurrentHost:(id)sender { |
| 400 contentSettingBubbleModel_->OnClearLinkClicked(); | 403 contentSettingBubbleModel_->OnClearLinkClicked(); |
| 401 [self close]; | 404 [self close]; |
| 402 } | 405 } |
| 403 | 406 |
| 404 @end // ContentBlockedBubbleController | 407 @end // ContentBlockedBubbleController |
| OLD | NEW |