| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 258 |
| 258 int text = IDS_PAGE_INFO_INTERNAL_PAGE; | 259 int text = IDS_PAGE_INFO_INTERNAL_PAGE; |
| 259 int icon = IDR_PRODUCT_LOGO_16; | 260 int icon = IDR_PRODUCT_LOGO_16; |
| 260 if (url.SchemeIs(extensions::kExtensionScheme)) { | 261 if (url.SchemeIs(extensions::kExtensionScheme)) { |
| 261 text = IDS_PAGE_INFO_EXTENSION_PAGE; | 262 text = IDS_PAGE_INFO_EXTENSION_PAGE; |
| 262 icon = IDR_PLUGINS_FAVICON; | 263 icon = IDR_PLUGINS_FAVICON; |
| 263 } else if (url.SchemeIs(content::kViewSourceScheme)) { | 264 } else if (url.SchemeIs(content::kViewSourceScheme)) { |
| 264 text = IDS_PAGE_INFO_VIEW_SOURCE_PAGE; | 265 text = IDS_PAGE_INFO_VIEW_SOURCE_PAGE; |
| 265 // view-source scheme uses the same icon as chrome:// pages. | 266 // view-source scheme uses the same icon as chrome:// pages. |
| 266 icon = IDR_PRODUCT_LOGO_16; | 267 icon = IDR_PRODUCT_LOGO_16; |
| 267 } else if (!url.SchemeIs(content::kChromeUIScheme)) { | 268 } else if (!url.SchemeIs(content::kChromeUIScheme) && |
| 269 !url.SchemeIs(content::kChromeDevToolsScheme)) { |
| 268 NOTREACHED(); | 270 NOTREACHED(); |
| 269 } | 271 } |
| 270 | 272 |
| 271 NSPoint controlOrigin = | 273 NSPoint controlOrigin = |
| 272 NSMakePoint(kInternalPageFramePadding, | 274 NSMakePoint(kInternalPageFramePadding, |
| 273 kInternalPageFramePadding + info_bubble::kBubbleArrowHeight); | 275 kInternalPageFramePadding + info_bubble::kBubbleArrowHeight); |
| 274 NSImage* productLogoImage = rb.GetNativeImageNamed(icon).ToNSImage(); | 276 NSImage* productLogoImage = rb.GetNativeImageNamed(icon).ToNSImage(); |
| 275 NSImageView* imageView = [self addImageWithSize:[productLogoImage size] | 277 NSImageView* imageView = [self addImageWithSize:[productLogoImage size] |
| 276 toView:contentView_ | 278 toView:contentView_ |
| 277 atPoint:controlOrigin]; | 279 atPoint:controlOrigin]; |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 void WebsiteSettingsUIBridge::SetPermissionInfo( | 1199 void WebsiteSettingsUIBridge::SetPermissionInfo( |
| 1198 const PermissionInfoList& permission_info_list, | 1200 const PermissionInfoList& permission_info_list, |
| 1199 const ChosenObjectInfoList& chosen_object_info_list) { | 1201 const ChosenObjectInfoList& chosen_object_info_list) { |
| 1200 [bubble_controller_ setPermissionInfo:permission_info_list | 1202 [bubble_controller_ setPermissionInfo:permission_info_list |
| 1201 andChosenObjects:chosen_object_info_list]; | 1203 andChosenObjects:chosen_object_info_list]; |
| 1202 } | 1204 } |
| 1203 | 1205 |
| 1204 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { | 1206 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { |
| 1205 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) | 1207 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) |
| 1206 } | 1208 } |
| OLD | NEW |