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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(), | 407 GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(), |
408 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 408 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
409 false)); | 409 false)); |
410 } | 410 } |
411 | 411 |
412 // TODO(lgarron): Move some of this to the presenter for separation of concerns | 412 // TODO(lgarron): Move some of this to the presenter for separation of concerns |
413 // and platform unification. (https://crbug.com/571533) | 413 // and platform unification. (https://crbug.com/571533) |
414 - (void)openConnectionHelp:(id)sender { | 414 - (void)openConnectionHelp:(id)sender { |
415 DCHECK(webContents_); | 415 DCHECK(webContents_); |
416 DCHECK(presenter_); | 416 DCHECK(presenter_); |
417 presenter_->RecordWebsiteSettingsAction( | 417 |
418 WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_HELP_OPENED); | 418 // Shift+Click of this link launches the Certificate Viewer directly. |
419 webContents_->OpenURL(content::OpenURLParams( | 419 BOOL shiftKeyDown = ([[NSApp currentEvent] modifierFlags] & |
420 GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(), | 420 (NSShiftKeyMask | NSAlphaShiftKeyMask)) != 0; |
421 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 421 if (certificate_ && shiftKeyDown) { |
422 false)); | 422 presenter_->RecordWebsiteSettingsAction( |
| 423 WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED); |
| 424 [self showCertificateInfo:sender]; |
| 425 } else { |
| 426 // Otherwise, open the Connection Security Help topic. |
| 427 presenter_->RecordWebsiteSettingsAction( |
| 428 WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_HELP_OPENED); |
| 429 webContents_->OpenURL(content::OpenURLParams( |
| 430 GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(), |
| 431 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
| 432 false)); |
| 433 } |
423 } | 434 } |
424 | 435 |
425 // Handler for the link button to show certificate information. | 436 // Handler for the link button to show certificate information. |
426 - (void)showCertificateInfo:(id)sender { | 437 - (void)showCertificateInfo:(id)sender { |
427 DCHECK(certificate_.get()); | 438 DCHECK(certificate_.get()); |
428 DCHECK(presenter_); | 439 DCHECK(presenter_); |
429 presenter_->RecordWebsiteSettingsAction( | 440 presenter_->RecordWebsiteSettingsAction( |
430 WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED); | 441 WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED); |
431 ShowCertificateViewer(webContents_, [self parentWindow], certificate_.get()); | 442 ShowCertificateViewer(webContents_, [self parentWindow], certificate_.get()); |
432 } | 443 } |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 const CookieInfoList& cookie_info_list) { | 1220 const CookieInfoList& cookie_info_list) { |
1210 [bubble_controller_ setCookieInfo:cookie_info_list]; | 1221 [bubble_controller_ setCookieInfo:cookie_info_list]; |
1211 } | 1222 } |
1212 | 1223 |
1213 void WebsiteSettingsUIBridge::SetPermissionInfo( | 1224 void WebsiteSettingsUIBridge::SetPermissionInfo( |
1214 const PermissionInfoList& permission_info_list, | 1225 const PermissionInfoList& permission_info_list, |
1215 ChosenObjectInfoList chosen_object_info_list) { | 1226 ChosenObjectInfoList chosen_object_info_list) { |
1216 [bubble_controller_ setPermissionInfo:permission_info_list | 1227 [bubble_controller_ setPermissionInfo:permission_info_list |
1217 andChosenObjects:std::move(chosen_object_info_list)]; | 1228 andChosenObjects:std::move(chosen_object_info_list)]; |
1218 } | 1229 } |
OLD | NEW |