Chromium Code Reviews| Index: ui/gfx/color_profile.cc |
| diff --git a/ui/gfx/color_profile.cc b/ui/gfx/color_profile.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9c92a73ef366c4fb7ad3cf81b11d5b326d0748ac |
| --- /dev/null |
| +++ b/ui/gfx/color_profile.cc |
| @@ -0,0 +1,25 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "color_profile.h" |
| + |
| +namespace gfx { |
| + |
| +void ColorProfile::GetColorProfile(gfx::NativeViewId parent_hwnd, |
| + std::vector<char>* profile) { |
| + // Force data to leak so exit time destructors are not called. |
| + static std::map<gfx::NativeViewId, std::vector<char> >& data = |
| + *new std::map<gfx::NativeViewId, std::vector<char> >(); |
|
tony
2012/06/14 23:18:10
Nit: Can you use CR_DEFINE_STATIC_LOCAL?
tpayne
2012/06/14 23:19:09
I couldn't get that to parse correctly because of
|
| + |
| + profile->clear(); |
| + std::vector<char> stored_profile; |
| + if (data.find(parent_hwnd) == data.end()) { |
| + ReadProfile(parent_hwnd, &stored_profile); |
| + data[parent_hwnd] = stored_profile; |
| + } |
| + |
| + profile->assign(data[parent_hwnd].begin(), data[parent_hwnd].end()); |
| +} |
| + |
| +} // namespace gfx |