| 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 #import <AppKit/AppKit.h> | 9 #import <AppKit/AppKit.h> |
| 10 | 10 |
| 11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
| 13 #import "chrome/browser/certificate_viewer.h" | 13 #import "chrome/browser/certificate_viewer.h" |
| 14 #import "chrome/browser/ui/browser_dialogs.h" | 14 #import "chrome/browser/ui/browser_dialogs.h" |
| 15 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 15 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 16 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" | 16 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" |
| 17 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 17 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 18 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 18 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 19 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 19 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 20 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 20 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 21 #include "chrome/browser/ui/website_settings/website_settings_utils.h" |
| 21 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 22 #include "content/public/browser/cert_store.h" | 23 #include "content/public/browser/cert_store.h" |
| 23 #include "content/public/browser/page_navigator.h" | 24 #include "content/public/browser/page_navigator.h" |
| 24 #include "content/public/browser/user_metrics.h" | 25 #include "content/public/browser/user_metrics.h" |
| 25 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
| 26 #include "grit/chromium_strings.h" | 27 #include "grit/chromium_strings.h" |
| 27 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
| 28 #include "grit/theme_resources.h" | 29 #include "grit/theme_resources.h" |
| 29 #include "grit/ui_resources.h" | 30 #include "grit/ui_resources.h" |
| 30 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 31 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 void WebsiteSettingsUIBridge::set_bubble_controller( | 1131 void WebsiteSettingsUIBridge::set_bubble_controller( |
| 1131 WebsiteSettingsBubbleController* controller) { | 1132 WebsiteSettingsBubbleController* controller) { |
| 1132 bubble_controller_ = controller; | 1133 bubble_controller_ = controller; |
| 1133 } | 1134 } |
| 1134 | 1135 |
| 1135 void WebsiteSettingsUIBridge::Show(gfx::NativeWindow parent, | 1136 void WebsiteSettingsUIBridge::Show(gfx::NativeWindow parent, |
| 1136 Profile* profile, | 1137 Profile* profile, |
| 1137 TabContents* tab_contents, | 1138 TabContents* tab_contents, |
| 1138 const GURL& url, | 1139 const GURL& url, |
| 1139 const content::SSLStatus& ssl) { | 1140 const content::SSLStatus& ssl) { |
| 1140 bool is_internal_page = url.SchemeIs(chrome::kChromeInternalScheme) || | 1141 bool is_internal_page = InternalChromePage(url); |
| 1141 url.SchemeIs(chrome::kChromeUIScheme); | |
| 1142 | 1142 |
| 1143 // Create the bridge. This will be owned by the bubble controller. | 1143 // Create the bridge. This will be owned by the bubble controller. |
| 1144 WebsiteSettingsUIBridge* bridge = new WebsiteSettingsUIBridge(); | 1144 WebsiteSettingsUIBridge* bridge = new WebsiteSettingsUIBridge(); |
| 1145 | 1145 |
| 1146 // Create the bubble controller. It will dealloc itself when it closes. | 1146 // Create the bubble controller. It will dealloc itself when it closes. |
| 1147 WebsiteSettingsBubbleController* bubble_controller = | 1147 WebsiteSettingsBubbleController* bubble_controller = |
| 1148 [[WebsiteSettingsBubbleController alloc] initWithParentWindow:parent | 1148 [[WebsiteSettingsBubbleController alloc] initWithParentWindow:parent |
| 1149 websiteSettingsUIBridge:bridge | 1149 websiteSettingsUIBridge:bridge |
| 1150 tabContents:tab_contents | 1150 tabContents:tab_contents |
| 1151 isInternalPage:is_internal_page]; | 1151 isInternalPage:is_internal_page]; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1182 [bubble_controller_ setPermissionInfo:permission_info_list]; | 1182 [bubble_controller_ setPermissionInfo:permission_info_list]; |
| 1183 } | 1183 } |
| 1184 | 1184 |
| 1185 void WebsiteSettingsUIBridge::SetFirstVisit(const string16& first_visit) { | 1185 void WebsiteSettingsUIBridge::SetFirstVisit(const string16& first_visit) { |
| 1186 [bubble_controller_ setFirstVisit:first_visit]; | 1186 [bubble_controller_ setFirstVisit:first_visit]; |
| 1187 } | 1187 } |
| 1188 | 1188 |
| 1189 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { | 1189 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { |
| 1190 [bubble_controller_ setSelectedTab:tab_id]; | 1190 [bubble_controller_ setSelectedTab:tab_id]; |
| 1191 } | 1191 } |
| OLD | NEW |