| 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 24 matching lines...) Expand all Loading... |
| 35 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
| 36 #include "content/public/common/url_constants.h" | 36 #include "content/public/common/url_constants.h" |
| 37 #include "extensions/common/constants.h" | 37 #include "extensions/common/constants.h" |
| 38 #include "skia/ext/skia_utils_mac.h" | 38 #include "skia/ext/skia_utils_mac.h" |
| 39 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw
eaker.h" | 39 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw
eaker.h" |
| 40 #include "ui/base/cocoa/cocoa_base_utils.h" | 40 #include "ui/base/cocoa/cocoa_base_utils.h" |
| 41 #import "ui/base/cocoa/controls/hyperlink_button_cell.h" | 41 #import "ui/base/cocoa/controls/hyperlink_button_cell.h" |
| 42 #import "ui/base/cocoa/flipped_view.h" | 42 #import "ui/base/cocoa/flipped_view.h" |
| 43 #import "ui/base/cocoa/hover_image_button.h" | 43 #import "ui/base/cocoa/hover_image_button.h" |
| 44 #include "ui/base/l10n/l10n_util.h" | 44 #include "ui/base/l10n/l10n_util.h" |
| 45 #include "ui/base/material_design/material_design_controller.h" |
| 45 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 46 #import "ui/gfx/mac/coordinate_conversion.h" | 47 #import "ui/gfx/mac/coordinate_conversion.h" |
| 47 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 48 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| 48 #include "ui/resources/grit/ui_resources.h" | 49 #include "ui/resources/grit/ui_resources.h" |
| 49 | 50 |
| 50 using ChosenObjectInfoPtr = | 51 using ChosenObjectInfoPtr = |
| 51 std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo>; | 52 std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo>; |
| 52 using ChosenObjectDeleteCallback = | 53 using ChosenObjectDeleteCallback = |
| 53 base::Callback<void(const WebsiteSettingsUI::ChosenObjectInfo&)>; | 54 base::Callback<void(const WebsiteSettingsUI::ChosenObjectInfo&)>; |
| 54 | 55 |
| (...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 WebsiteSettingsBubbleController* controller) { | 1150 WebsiteSettingsBubbleController* controller) { |
| 1150 bubble_controller_ = controller; | 1151 bubble_controller_ = controller; |
| 1151 } | 1152 } |
| 1152 | 1153 |
| 1153 void WebsiteSettingsUIBridge::Show( | 1154 void WebsiteSettingsUIBridge::Show( |
| 1154 gfx::NativeWindow parent, | 1155 gfx::NativeWindow parent, |
| 1155 Profile* profile, | 1156 Profile* profile, |
| 1156 content::WebContents* web_contents, | 1157 content::WebContents* web_contents, |
| 1157 const GURL& virtual_url, | 1158 const GURL& virtual_url, |
| 1158 const security_state::SecurityInfo& security_info) { | 1159 const security_state::SecurityInfo& security_info) { |
| 1159 if (chrome::ToolkitViewsWebUIDialogsEnabled()) { | 1160 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { |
| 1160 chrome::ShowWebsiteSettingsBubbleViewsAtPoint( | 1161 chrome::ShowWebsiteSettingsBubbleViewsAtPoint( |
| 1161 gfx::ScreenPointFromNSPoint(AnchorPointForWindow(parent)), profile, | 1162 gfx::ScreenPointFromNSPoint(AnchorPointForWindow(parent)), profile, |
| 1162 web_contents, virtual_url, security_info); | 1163 web_contents, virtual_url, security_info); |
| 1163 return; | 1164 return; |
| 1164 } | 1165 } |
| 1165 | 1166 |
| 1166 // Don't show the popup if it's already being shown. Since this method is | 1167 // Don't show the popup if it's already being shown. Since this method is |
| 1167 // called each time the location icon is clicked, each click toggles the popup | 1168 // called each time the location icon is clicked, each click toggles the popup |
| 1168 // in and out. | 1169 // in and out. |
| 1169 if (g_is_popup_showing) | 1170 if (g_is_popup_showing) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 void WebsiteSettingsUIBridge::SetPermissionInfo( | 1215 void WebsiteSettingsUIBridge::SetPermissionInfo( |
| 1215 const PermissionInfoList& permission_info_list, | 1216 const PermissionInfoList& permission_info_list, |
| 1216 ChosenObjectInfoList chosen_object_info_list) { | 1217 ChosenObjectInfoList chosen_object_info_list) { |
| 1217 [bubble_controller_ setPermissionInfo:permission_info_list | 1218 [bubble_controller_ setPermissionInfo:permission_info_list |
| 1218 andChosenObjects:std::move(chosen_object_info_list)]; | 1219 andChosenObjects:std::move(chosen_object_info_list)]; |
| 1219 } | 1220 } |
| 1220 | 1221 |
| 1221 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { | 1222 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { |
| 1222 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) | 1223 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) |
| 1223 } | 1224 } |
| OLD | NEW |