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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 7687006: Implement input type=color UI (mac part) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebaselined Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698