Index: content/browser/renderer_host/render_widget_host_view_mac.mm |
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm |
index 25ee3ef43a73bfc0ef2a7445312dc43a12aa8270..b783f59c219a44f788ba02273ab830b43fa793d0 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm |
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm |
@@ -17,6 +17,7 @@ |
#include "base/sys_info.h" |
#include "base/sys_string_conversions.h" |
#include "base/utf_string_conversions.h" |
+#import "chrome/browser/ui/cocoa/color_utils.h" |
#import "content/browser/accessibility/browser_accessibility_cocoa.h" |
#include "content/browser/gpu/gpu_process_host.h" |
#include "content/browser/gpu/gpu_process_host_ui_shim.h" |
@@ -119,18 +120,6 @@ namespace { |
// Maximum number of characters we allow in a tooltip. |
const size_t kMaxTooltipLength = 1024; |
-// TODO(suzhe): Upstream this function. |
-WebKit::WebColor WebColorFromNSColor(NSColor *color) { |
- CGFloat r, g, b, a; |
- [color getRed:&r green:&g blue:&b alpha:&a]; |
- |
- return |
- std::max(0, std::min(static_cast<int>(lroundf(255.0f * a)), 255)) << 24 | |
- std::max(0, std::min(static_cast<int>(lroundf(255.0f * r)), 255)) << 16 | |
- std::max(0, std::min(static_cast<int>(lroundf(255.0f * g)), 255)) << 8 | |
- std::max(0, std::min(static_cast<int>(lroundf(255.0f * b)), 255)); |
-} |
- |
// Extract underline information from an attributed string. Mostly copied from |
// third_party/WebKit/Source/WebKit/mac/WebView/WebHTMLView.mm |
void ExtractUnderlines( |