| 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..94c9eb99886aec13177a9ea62bba370870f0003e
|
| --- /dev/null
|
| +++ b/ui/gfx/color_profile.cc
|
| @@ -0,0 +1,31 @@
|
| +// 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"
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/logging.h"
|
| +
|
| +namespace gfx {
|
| +
|
| +void GetColorProfile(gfx::NativeViewId parent_window,
|
| + std::vector<char>* profile) {
|
| + // Called from the FILE thread on Windows and IO thread elsewhere.
|
| + // Force data to leak so exit time destructors are not called.
|
| +
|
| + // TODO: support multiple monitors.
|
| + DCHECK(!parent_window);
|
| + CR_DEFINE_STATIC_LOCAL(std::vector<char>, screen_profile, ());
|
| + static bool initialized = false;
|
| +
|
| + profile->clear();
|
| + if (!initialized) {
|
| + initialized = true;
|
| + ReadColorProfile(parent_window, &screen_profile);
|
| + }
|
| +
|
| + profile->assign(screen_profile.begin(), screen_profile.end());
|
| +}
|
| +
|
| +} // namespace gfx
|
|
|