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

Unified Diff: ui/display/manager/display_manager_utilities.h

Issue 2286523002: Relocate reuseable portions of ash/display/display_util.* (Closed)
Patch Set: fixed ozone build Created 4 years, 4 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: ui/display/manager/display_manager_utilities.h
diff --git a/ash/display/display_util.h b/ui/display/manager/display_manager_utilities.h
similarity index 51%
copy from ash/display/display_util.h
copy to ui/display/manager/display_manager_utilities.h
index 483f9d1aa7968161015463ad7ce016f3c2d36233..5b37ac36e68fbacfa7e2276be6446fd99618eb53 100644
--- a/ash/display/display_util.h
+++ b/ui/display/manager/display_manager_utilities.h
@@ -1,18 +1,14 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
oshima 2016/08/26 21:55:59 IIRC, you don't have to update this when you're m
rjkroege 2016/08/30 19:11:06 Good to know. Thanks. I'll leave.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_DISPLAY_DISPLAY_UTIL_H_
-#define ASH_DISPLAY_DISPLAY_UTIL_H_
-
-#include <stdint.h>
+#ifndef UI_DISPLAY_MANAGER_DISPLAY_MANAGER_UTILITIES_H_
+#define UI_DISPLAY_MANAGER_DISPLAY_MANAGER_UTILITIES_H_
#include <set>
-#include <utility>
-#include <vector>
-#include "ash/ash_export.h"
-#include "base/memory/ref_counted.h"
+#include "ui/display/display.h"
+#include "ui/display/display_export.h"
#include "ui/display/manager/display_layout.h"
#include "ui/display/manager/managed_display_info.h"
@@ -24,78 +20,56 @@ class Size;
namespace ui {
class ManagedDisplayInfo;
-}
-
-namespace ash {
-class AshWindowTreeHost;
class ManagedDisplayMode;
// Creates the display mode list for internal display
// based on |native_mode|.
-ASH_EXPORT ui::ManagedDisplayInfo::ManagedDisplayModeList
+DISPLAY_EXPORT ui::ManagedDisplayInfo::ManagedDisplayModeList
CreateInternalManagedDisplayModeList(
const scoped_refptr<ui::ManagedDisplayMode>& native_mode);
// Creates the display mode list for unified display
// based on |native_mode| and |scales|.
-ASH_EXPORT ui::ManagedDisplayInfo::ManagedDisplayModeList
+DISPLAY_EXPORT ui::ManagedDisplayInfo::ManagedDisplayModeList
CreateUnifiedManagedDisplayModeList(
const scoped_refptr<ui::ManagedDisplayMode>& native_mode,
const std::set<std::pair<float, float>>& dsf_scale_list);
// Gets the display mode for |resolution|. Returns false if no display
// mode matches the resolution, or the display is an internal display.
-ASH_EXPORT scoped_refptr<ui::ManagedDisplayMode> GetDisplayModeForResolution(
- const ui::ManagedDisplayInfo& info,
- const gfx::Size& resolution);
+DISPLAY_EXPORT scoped_refptr<ui::ManagedDisplayMode>
+GetDisplayModeForResolution(const ui::ManagedDisplayInfo& info,
+ const gfx::Size& resolution);
// Gets the display mode for the next valid UI scale. Returns false
// if the display is not an internal display.
-ASH_EXPORT scoped_refptr<ui::ManagedDisplayMode> GetDisplayModeForNextUIScale(
- const ui::ManagedDisplayInfo& info,
- bool up);
+DISPLAY_EXPORT scoped_refptr<ui::ManagedDisplayMode>
+GetDisplayModeForNextUIScale(const ui::ManagedDisplayInfo& info, bool up);
// Gets the display mode for the next valid resolution. Returns false
// if the display is an internal display.
-ASH_EXPORT scoped_refptr<ui::ManagedDisplayMode>
+DISPLAY_EXPORT scoped_refptr<ui::ManagedDisplayMode>
GetDisplayModeForNextResolution(const ui::ManagedDisplayInfo& info, bool up);
-// Sets the UI scale for the |display_id|. Returns false if the
-// display_id is not an internal display.
-ASH_EXPORT bool SetDisplayUIScale(int64_t display_id, float scale);
-
// Tests if the |info| has display mode that matches |ui_scale|.
bool HasDisplayModeForUIScale(const ui::ManagedDisplayInfo& info,
float ui_scale);
// Computes the bounds that defines the bounds between two displays.
// Returns false if two displays do not intersect.
-bool ComputeBoundary(const display::Display& primary_display,
- const display::Display& secondary_display,
- gfx::Rect* primary_edge_in_screen,
- gfx::Rect* secondary_edge_in_screen);
-
-// Creates edge bounds from |bounds_in_screen| that fits the edge
-// of the native window for |ash_host|.
-ASH_EXPORT gfx::Rect GetNativeEdgeBounds(AshWindowTreeHost* ash_host,
- const gfx::Rect& bounds_in_screen);
-
-// Moves the cursor to the point inside the |ash_host| that is closest to
-// the point_in_screen, which may be outside of the root window.
-// |update_last_loation_now| is used for the test to update the mouse
-// location synchronously.
-void MoveCursorTo(AshWindowTreeHost* ash_host,
- const gfx::Point& point_in_screen,
- bool update_last_location_now);
+DISPLAY_EXPORT bool ComputeBoundary(const display::Display& primary_display,
+ const display::Display& secondary_display,
+ gfx::Rect* primary_edge_in_screen,
+ gfx::Rect* secondary_edge_in_screen);
// Returns the index in the displays whose bounds contains |point_in_screen|.
// Returns -1 if no such display exist.
-ASH_EXPORT int FindDisplayIndexContainingPoint(
+DISPLAY_EXPORT int FindDisplayIndexContainingPoint(
const std::vector<display::Display>& displays,
const gfx::Point& point_in_screen);
// Sorts id list using |CompareDisplayIds| below.
-ASH_EXPORT void SortDisplayIdList(display::DisplayIdList* list);
+DISPLAY_EXPORT void SortDisplayIdList(display::DisplayIdList* list);
// Default id generator.
class DefaultDisplayIdGenerator {
@@ -119,24 +93,17 @@ display::DisplayIdList GenerateDisplayIdList(
}
// Creates sorted display::DisplayIdList.
-ASH_EXPORT display::DisplayIdList CreateDisplayIdList(
+DISPLAY_EXPORT display::DisplayIdList CreateDisplayIdList(
const display::DisplayList& list);
-ASH_EXPORT std::string DisplayIdListToString(
+DISPLAY_EXPORT std::string DisplayIdListToString(
const display::DisplayIdList& list);
-// Returns true if one of following conditinos is met.
+// Returns true if one of following conditions is met.
// 1) id1 is internal.
// 2) output index of id1 < output index of id2 and id2 isn't internal.
-ASH_EXPORT bool CompareDisplayIds(int64_t id1, int64_t id2);
-
-#if defined(OS_CHROMEOS)
-// Shows the notification message for display related issues.
-void ShowDisplayErrorNotification(int message_id);
-#endif
-
-ASH_EXPORT base::string16 GetDisplayErrorNotificationMessageForTest();
+DISPLAY_EXPORT bool CompareDisplayIds(int64_t id1, int64_t id2);
-} // namespace ash
+} // namespace ui
-#endif // ASH_DISPLAY_DISPLAY_UTIL_H_
+#endif // UI_DISPLAY_MANAGER_DISPLAY_MANAGER_UTILITIES_H_

Powered by Google App Engine
This is Rietveld 408576698