| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/website_settings/website_settings_bubble_contro
ller.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_contro
ller.h" |
| 6 | 6 |
| 7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 @end | 178 @end |
| 179 | 179 |
| 180 @implementation WebsiteSettingsBubbleController | 180 @implementation WebsiteSettingsBubbleController |
| 181 | 181 |
| 182 - (CGFloat)defaultWindowWidth { | 182 - (CGFloat)defaultWindowWidth { |
| 183 return kDefaultWindowWidth; | 183 return kDefaultWindowWidth; |
| 184 } | 184 } |
| 185 | 185 |
| 186 bool IsInternalURL(const GURL& url) { | 186 bool IsInternalURL(const GURL& url) { |
| 187 return url.SchemeIs(content::kChromeUIScheme) || | 187 return url.SchemeIs(content::kChromeUIScheme) || |
| 188 url.SchemeIs(content::kChromeDevToolsScheme) || |
| 188 url.SchemeIs(extensions::kExtensionScheme) || | 189 url.SchemeIs(extensions::kExtensionScheme) || |
| 189 url.SchemeIs(content::kViewSourceScheme); | 190 url.SchemeIs(content::kViewSourceScheme); |
| 190 } | 191 } |
| 191 | 192 |
| 192 - (id)initWithParentWindow:(NSWindow*)parentWindow | 193 - (id)initWithParentWindow:(NSWindow*)parentWindow |
| 193 websiteSettingsUIBridge:(WebsiteSettingsUIBridge*)bridge | 194 websiteSettingsUIBridge:(WebsiteSettingsUIBridge*)bridge |
| 194 webContents:(content::WebContents*)webContents | 195 webContents:(content::WebContents*)webContents |
| 195 url:(const GURL&)url | 196 url:(const GURL&)url |
| 196 isDevToolsDisabled:(BOOL)isDevToolsDisabled { | 197 isDevToolsDisabled:(BOOL)isDevToolsDisabled { |
| 197 DCHECK(parentWindow); | 198 DCHECK(parentWindow); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 254 |
| 254 int text = IDS_PAGE_INFO_INTERNAL_PAGE; | 255 int text = IDS_PAGE_INFO_INTERNAL_PAGE; |
| 255 int icon = IDR_PRODUCT_LOGO_16; | 256 int icon = IDR_PRODUCT_LOGO_16; |
| 256 if (url.SchemeIs(extensions::kExtensionScheme)) { | 257 if (url.SchemeIs(extensions::kExtensionScheme)) { |
| 257 text = IDS_PAGE_INFO_EXTENSION_PAGE; | 258 text = IDS_PAGE_INFO_EXTENSION_PAGE; |
| 258 icon = IDR_PLUGINS_FAVICON; | 259 icon = IDR_PLUGINS_FAVICON; |
| 259 } else if (url.SchemeIs(content::kViewSourceScheme)) { | 260 } else if (url.SchemeIs(content::kViewSourceScheme)) { |
| 260 text = IDS_PAGE_INFO_VIEW_SOURCE_PAGE; | 261 text = IDS_PAGE_INFO_VIEW_SOURCE_PAGE; |
| 261 // view-source scheme uses the same icon as chrome:// pages. | 262 // view-source scheme uses the same icon as chrome:// pages. |
| 262 icon = IDR_PRODUCT_LOGO_16; | 263 icon = IDR_PRODUCT_LOGO_16; |
| 263 } else if (!url.SchemeIs(content::kChromeUIScheme)) { | 264 } else if (!url.SchemeIs(content::kChromeUIScheme) && |
| 265 !url.SchemeIs(content::kChromeDevToolsScheme)) { |
| 264 NOTREACHED(); | 266 NOTREACHED(); |
| 265 } | 267 } |
| 266 | 268 |
| 267 NSPoint controlOrigin = | 269 NSPoint controlOrigin = |
| 268 NSMakePoint(kInternalPageFramePadding, | 270 NSMakePoint(kInternalPageFramePadding, |
| 269 kInternalPageFramePadding + info_bubble::kBubbleArrowHeight); | 271 kInternalPageFramePadding + info_bubble::kBubbleArrowHeight); |
| 270 NSImage* productLogoImage = rb.GetNativeImageNamed(icon).ToNSImage(); | 272 NSImage* productLogoImage = rb.GetNativeImageNamed(icon).ToNSImage(); |
| 271 NSImageView* imageView = [self addImageWithSize:[productLogoImage size] | 273 NSImageView* imageView = [self addImageWithSize:[productLogoImage size] |
| 272 toView:contentView_ | 274 toView:contentView_ |
| 273 atPoint:controlOrigin]; | 275 atPoint:controlOrigin]; |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 void WebsiteSettingsUIBridge::SetPermissionInfo( | 1193 void WebsiteSettingsUIBridge::SetPermissionInfo( |
| 1192 const PermissionInfoList& permission_info_list, | 1194 const PermissionInfoList& permission_info_list, |
| 1193 const ChosenObjectInfoList& chosen_object_info_list) { | 1195 const ChosenObjectInfoList& chosen_object_info_list) { |
| 1194 [bubble_controller_ setPermissionInfo:permission_info_list | 1196 [bubble_controller_ setPermissionInfo:permission_info_list |
| 1195 andChosenObjects:chosen_object_info_list]; | 1197 andChosenObjects:chosen_object_info_list]; |
| 1196 } | 1198 } |
| 1197 | 1199 |
| 1198 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { | 1200 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { |
| 1199 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) | 1201 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) |
| 1200 } | 1202 } |
| OLD | NEW |