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 #import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h
" | 5 #import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h
" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 238 |
239 struct ContentTypeToNibPath { | 239 struct ContentTypeToNibPath { |
240 ContentSettingsType type; | 240 ContentSettingsType type; |
241 NSString* path; | 241 NSString* path; |
242 }; | 242 }; |
243 | 243 |
244 const ContentTypeToNibPath kNibPaths[] = { | 244 const ContentTypeToNibPath kNibPaths[] = { |
245 {CONTENT_SETTINGS_TYPE_COOKIES, @"ContentBlockedCookies"}, | 245 {CONTENT_SETTINGS_TYPE_COOKIES, @"ContentBlockedCookies"}, |
246 {CONTENT_SETTINGS_TYPE_IMAGES, @"ContentBlockedSimple"}, | 246 {CONTENT_SETTINGS_TYPE_IMAGES, @"ContentBlockedSimple"}, |
247 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, @"ContentBlockedSimple"}, | 247 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, @"ContentBlockedSimple"}, |
| 248 {CONTENT_SETTINGS_TYPE_KEYGEN, @"ContentBlockedSimple"}, |
248 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, @"ContentBlockedSimple"}, | 249 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, @"ContentBlockedSimple"}, |
249 {CONTENT_SETTINGS_TYPE_PLUGINS, @"ContentBlockedPlugins"}, | 250 {CONTENT_SETTINGS_TYPE_PLUGINS, @"ContentBlockedPlugins"}, |
250 {CONTENT_SETTINGS_TYPE_POPUPS, @"ContentBlockedPopups"}, | 251 {CONTENT_SETTINGS_TYPE_POPUPS, @"ContentBlockedPopups"}, |
251 {CONTENT_SETTINGS_TYPE_GEOLOCATION, @"ContentBlockedGeolocation"}, | 252 {CONTENT_SETTINGS_TYPE_GEOLOCATION, @"ContentBlockedGeolocation"}, |
252 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, @"ContentBlockedMixedScript"}, | 253 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, @"ContentBlockedMixedScript"}, |
253 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, @"ContentProtocolHandlers"}, | 254 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, @"ContentProtocolHandlers"}, |
254 {CONTENT_SETTINGS_TYPE_MEDIASTREAM, @"ContentBlockedMedia"}, | 255 {CONTENT_SETTINGS_TYPE_MEDIASTREAM, @"ContentBlockedMedia"}, |
255 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, @"ContentBlockedDownloads"}, | 256 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, @"ContentBlockedDownloads"}, |
256 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, @"ContentBlockedMIDISysEx"}, | 257 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, @"ContentBlockedMIDISysEx"}, |
| 258 {CONTENT_SETTINGS_TYPE_KEYGEN, @"ContentBlockedSimple"}, |
257 }; | 259 }; |
258 | 260 |
259 - (id)initWithModel:(ContentSettingBubbleModel*)contentSettingBubbleModel | 261 - (id)initWithModel:(ContentSettingBubbleModel*)contentSettingBubbleModel |
260 webContents:(content::WebContents*)webContents | 262 webContents:(content::WebContents*)webContents |
261 parentWindow:(NSWindow*)parentWindow | 263 parentWindow:(NSWindow*)parentWindow |
262 anchoredAt:(NSPoint)anchoredAt { | 264 anchoredAt:(NSPoint)anchoredAt { |
263 // This method takes ownership of |contentSettingBubbleModel| in all cases. | 265 // This method takes ownership of |contentSettingBubbleModel| in all cases. |
264 scoped_ptr<ContentSettingBubbleModel> model(contentSettingBubbleModel); | 266 scoped_ptr<ContentSettingBubbleModel> model(contentSettingBubbleModel); |
265 DCHECK(model.get()); | 267 DCHECK(model.get()); |
266 observerBridge_.reset( | 268 observerBridge_.reset( |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 button, base::SysUTF16ToNSString(it->second->model->GetLabelAt(index))); | 828 button, base::SysUTF16ToNSString(it->second->model->GetLabelAt(index))); |
827 | 829 |
828 it->second->model->ExecuteCommand(index, 0); | 830 it->second->model->ExecuteCommand(index, 0); |
829 } | 831 } |
830 | 832 |
831 - (content_setting_bubble::MediaMenuPartsMap*)mediaMenus { | 833 - (content_setting_bubble::MediaMenuPartsMap*)mediaMenus { |
832 return &mediaMenus_; | 834 return &mediaMenus_; |
833 } | 835 } |
834 | 836 |
835 @end // ContentSettingBubbleController | 837 @end // ContentSettingBubbleController |
OLD | NEW |