Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm

Issue 2676673002: Add a shortcut that opens Certificate Viewer from the Page Info flyout (Closed)
Patch Set: Detect Shift Click on Mac PageInfo Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/website_settings/website_settings_popup_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/website_settings/website_settings_popup_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698