| 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 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #import <AppKit/AppKit.h> | 9 #import <AppKit/AppKit.h> |
| 10 | 10 |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 bubble_controller_(nil) {} | 1264 bubble_controller_(nil) {} |
| 1265 | 1265 |
| 1266 WebsiteSettingsUIBridge::~WebsiteSettingsUIBridge() { | 1266 WebsiteSettingsUIBridge::~WebsiteSettingsUIBridge() { |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 void WebsiteSettingsUIBridge::set_bubble_controller( | 1269 void WebsiteSettingsUIBridge::set_bubble_controller( |
| 1270 WebsiteSettingsBubbleController* controller) { | 1270 WebsiteSettingsBubbleController* controller) { |
| 1271 bubble_controller_ = controller; | 1271 bubble_controller_ = controller; |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 void WebsiteSettingsUIBridge::Show(gfx::NativeWindow parent, | 1274 void WebsiteSettingsUIBridge::Show( |
| 1275 Profile* profile, | 1275 gfx::NativeWindow parent, |
| 1276 content::WebContents* web_contents, | 1276 Profile* profile, |
| 1277 const GURL& url, | 1277 content::WebContents* web_contents, |
| 1278 const content::SSLStatus& ssl) { | 1278 const GURL& url, |
| 1279 const SecurityStateModel::SecurityInfo& security_info) { |
| 1279 if (chrome::ToolkitViewsDialogsEnabled()) { | 1280 if (chrome::ToolkitViewsDialogsEnabled()) { |
| 1280 chrome::ShowWebsiteSettingsBubbleViewsAtPoint( | 1281 chrome::ShowWebsiteSettingsBubbleViewsAtPoint( |
| 1281 gfx::ScreenPointFromNSPoint(AnchorPointForWindow(parent)), profile, | 1282 gfx::ScreenPointFromNSPoint(AnchorPointForWindow(parent)), profile, |
| 1282 web_contents, url, ssl); | 1283 web_contents, url, security_info); |
| 1283 return; | 1284 return; |
| 1284 } | 1285 } |
| 1285 | 1286 |
| 1286 bool is_internal_page = InternalChromePage(url); | 1287 bool is_internal_page = InternalChromePage(url); |
| 1287 | 1288 |
| 1288 // Create the bridge. This will be owned by the bubble controller. | 1289 // Create the bridge. This will be owned by the bubble controller. |
| 1289 WebsiteSettingsUIBridge* bridge = new WebsiteSettingsUIBridge(web_contents); | 1290 WebsiteSettingsUIBridge* bridge = new WebsiteSettingsUIBridge(web_contents); |
| 1290 | 1291 |
| 1291 // Create the bubble controller. It will dealloc itself when it closes. | 1292 // Create the bubble controller. It will dealloc itself when it closes. |
| 1292 WebsiteSettingsBubbleController* bubble_controller = | 1293 WebsiteSettingsBubbleController* bubble_controller = |
| 1293 [[WebsiteSettingsBubbleController alloc] | 1294 [[WebsiteSettingsBubbleController alloc] |
| 1294 initWithParentWindow:parent | 1295 initWithParentWindow:parent |
| 1295 websiteSettingsUIBridge:bridge | 1296 websiteSettingsUIBridge:bridge |
| 1296 webContents:web_contents | 1297 webContents:web_contents |
| 1297 isInternalPage:is_internal_page]; | 1298 isInternalPage:is_internal_page]; |
| 1298 | 1299 |
| 1299 if (!is_internal_page) { | 1300 if (!is_internal_page) { |
| 1300 // Initialize the presenter, which holds the model and controls the UI. | 1301 // Initialize the presenter, which holds the model and controls the UI. |
| 1301 // This is also owned by the bubble controller. | 1302 // This is also owned by the bubble controller. |
| 1302 WebsiteSettings* presenter = new WebsiteSettings( | 1303 WebsiteSettings* presenter = new WebsiteSettings( |
| 1303 bridge, profile, | 1304 bridge, profile, |
| 1304 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, | 1305 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, |
| 1305 url, ssl, content::CertStore::GetInstance()); | 1306 url, security_info, content::CertStore::GetInstance()); |
| 1306 [bubble_controller setPresenter:presenter]; | 1307 [bubble_controller setPresenter:presenter]; |
| 1307 } | 1308 } |
| 1308 | 1309 |
| 1309 [bubble_controller showWindow:nil]; | 1310 [bubble_controller showWindow:nil]; |
| 1310 } | 1311 } |
| 1311 | 1312 |
| 1312 void WebsiteSettingsUIBridge::SetIdentityInfo( | 1313 void WebsiteSettingsUIBridge::SetIdentityInfo( |
| 1313 const WebsiteSettingsUI::IdentityInfo& identity_info) { | 1314 const WebsiteSettingsUI::IdentityInfo& identity_info) { |
| 1314 [bubble_controller_ setIdentityInfo:identity_info]; | 1315 [bubble_controller_ setIdentityInfo:identity_info]; |
| 1315 } | 1316 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1327 } | 1328 } |
| 1328 | 1329 |
| 1329 void WebsiteSettingsUIBridge::SetPermissionInfo( | 1330 void WebsiteSettingsUIBridge::SetPermissionInfo( |
| 1330 const PermissionInfoList& permission_info_list) { | 1331 const PermissionInfoList& permission_info_list) { |
| 1331 [bubble_controller_ setPermissionInfo:permission_info_list]; | 1332 [bubble_controller_ setPermissionInfo:permission_info_list]; |
| 1332 } | 1333 } |
| 1333 | 1334 |
| 1334 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { | 1335 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { |
| 1335 [bubble_controller_ setSelectedTab:tab_id]; | 1336 [bubble_controller_ setSelectedTab:tab_id]; |
| 1336 } | 1337 } |
| OLD | NEW |