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

Unified Diff: content/public/common/screen_info.h

Issue 2317563004: Change blink::WebScreenInfo to content::ScreenInfo (Closed)
Patch Set: Fix Windows compile Created 4 years, 3 months 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
Index: content/public/common/screen_info.h
diff --git a/content/public/common/screen_info.h b/content/public/common/screen_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..ea3a57f673b9f9d393e1f804d6aa3ba55e91dbda
--- /dev/null
+++ b/content/public/common/screen_info.h
@@ -0,0 +1,51 @@
+// Copyright 2016 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.
+
+#ifndef CONTENT_PUBLIC_COMMON_SCREEN_INFO_H_
+#define CONTENT_PUBLIC_COMMON_SCREEN_INFO_H_
+
+#include "content/public/common/screen_orientation_values.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace content {
+
+// Information about the screen on which a RenderWidget is being displayed. This
+// is the content counterpart to WebScreenInfo in blink.
+struct ScreenInfo {
+ // Device scale factor. Specifies the ratio between physical and logical
+ // pixels.
+ float device_scale_factor = 1.f;
+
+ // The screen depth in bits per pixel
+ uint32_t depth = 0;
+
+ // The bits per colour component. This assumes that the colours are balanced
+ // equally.
+ uint32_t depth_per_component = 0;
+
+ // This can be true for black and white printers
+ bool is_monochrome = false;
+
+ // The display monitor rectangle in virtual-screen coordinates. Note that
+ // this may be negative.
+ gfx::Rect rect;
+
+ // The portion of the monitor's rectangle that can be used by applications.
+ gfx::Rect available_rect;
+
+ // The monitor's orientation.
+ ScreenOrientationValues orientation_type =
+ SCREEN_ORIENTATION_VALUES_DEFAULT;
+
+ // This is the orientation angle of the displayed content in degrees.
+ // It is the opposite of the physical rotation.
+ uint16_t orientation_angle = 0;
+
+ bool operator==(const ScreenInfo& other) const;
+ bool operator!=(const ScreenInfo& other) const;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_SCREEN_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698