| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/website_settings_bubble_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| 11 #import "chrome/browser/certificate_viewer.h" | 11 #import "chrome/browser/certificate_viewer.h" |
| 12 #import "chrome/browser/ui/browser_dialogs.h" | 12 #import "chrome/browser/ui/browser_dialogs.h" |
| 13 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 13 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 14 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" | 14 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" |
| 15 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 15 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 16 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 16 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 17 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 17 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 18 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 20 #include "content/public/browser/cert_store.h" | 20 #include "content/public/browser/cert_store.h" |
| 21 #include "content/public/browser/page_navigator.h" | 21 #include "content/public/browser/page_navigator.h" |
| 22 #include "content/public/browser/user_metrics.h" |
| 22 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 23 #include "grit/chromium_strings.h" | 24 #include "grit/chromium_strings.h" |
| 24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 25 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
| 26 #include "grit/ui_resources.h" | 27 #include "grit/ui_resources.h" |
| 27 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 28 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
| 28 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 29 #include "ui/base/resource/resource_bundle.h" | 30 #include "ui/base/resource/resource_bundle.h" |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 toView:contentView]; | 440 toView:contentView]; |
| 440 [cookiesButton_ setTarget:self]; | 441 [cookiesButton_ setTarget:self]; |
| 441 [cookiesButton_ setAction:@selector(showCookiesAndSiteData:)]; | 442 [cookiesButton_ setAction:@selector(showCookiesAndSiteData:)]; |
| 442 | 443 |
| 443 return contentView.get(); | 444 return contentView.get(); |
| 444 } | 445 } |
| 445 | 446 |
| 446 // Handler for the link button below the list of cookies. | 447 // Handler for the link button below the list of cookies. |
| 447 - (void)showCookiesAndSiteData:(id)sender { | 448 - (void)showCookiesAndSiteData:(id)sender { |
| 448 DCHECK(tabContents_); | 449 DCHECK(tabContents_); |
| 450 content::RecordAction( |
| 451 content::UserMetricsAction("WebsiteSettings_CookiesDialogOpened")); |
| 449 chrome::ShowCollectedCookiesDialog(tabContents_); | 452 chrome::ShowCollectedCookiesDialog(tabContents_); |
| 450 } | 453 } |
| 451 | 454 |
| 452 // Handler for the link button to show certificate information. | 455 // Handler for the link button to show certificate information. |
| 453 - (void)showCertificateInfo:(id)sender { | 456 - (void)showCertificateInfo:(id)sender { |
| 454 DCHECK(certificateId_); | 457 DCHECK(certificateId_); |
| 455 ShowCertificateViewerByID(tabContents_->web_contents(), | 458 ShowCertificateViewerByID(tabContents_->web_contents(), |
| 456 [self parentWindow], | 459 [self parentWindow], |
| 457 certificateId_); | 460 certificateId_); |
| 458 } | 461 } |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 [bubble_controller_ setPermissionInfo:permission_info_list]; | 1118 [bubble_controller_ setPermissionInfo:permission_info_list]; |
| 1116 } | 1119 } |
| 1117 | 1120 |
| 1118 void WebsiteSettingsUIBridge::SetFirstVisit(const string16& first_visit) { | 1121 void WebsiteSettingsUIBridge::SetFirstVisit(const string16& first_visit) { |
| 1119 [bubble_controller_ setFirstVisit:first_visit]; | 1122 [bubble_controller_ setFirstVisit:first_visit]; |
| 1120 } | 1123 } |
| 1121 | 1124 |
| 1122 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { | 1125 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { |
| 1123 [bubble_controller_ setSelectedTab:tab_id]; | 1126 [bubble_controller_ setSelectedTab:tab_id]; |
| 1124 } | 1127 } |
| OLD | NEW |