Reland of Android: support multiple displays on C++ side

Original description:

Starting with API 17 Android can have multiple displays.

CL https://codereview.chromium.org/2361633002 introduced the map
of DisplayAndroid objects on Java side. This CL uses the information
from Java layer to maintain a similar map on the native side.

Similar to other platforms, an individual display is represented
by a Display object, and the collection of all displays in the
system is the Screen object. The Screen object for Android
maintains the mapping between the Android display ID and Display
and receives updates from DisplayAndroidManager.java through JNI.
Therefore the Screen implementation is placed in DisplayAndroidManager
class.

The Screen interface assumes the existence of the primary display.
To support this we always add the primary display on the Java side
(it is propagated to native) during the initialization of
DisplayAndroidManager.java

Native DisplayAndroidManager obtains the display ID from WindowAndroid
and thus depends on /ui/android. This CL places the manager in /ui/android
as well. Because of this we have to explicitly initialize the Screen
singleton by calling SetScreenAndroid() (similar to
other platforms) instead of creating the Screen object on demand.

The explicit initialization of the Screen happens on most platforms,
and required some tests modification.

Note: the explicit initialization of the Android Screen object required
some tests modification. Since the screen used to be created on demand,
we could have missed some tests that run on Android and not
covered by CQ.

BUG=625089

> > Committed: https://crrev.com/3da850c3bfadcf3d83407bb4aa9b1e047cbd44a8
> > Cr-Commit-Position: refs/heads/master@{#432310}

> Revert:
> Committed: https://crrev.com/ece04082b79fd30261b48ad895e7f05beeda7823
> Cr-Commit-Position: refs/heads/master@{#433108}

Review-Url: https://codereview.chromium.org/2416403002
Cr-Commit-Position: refs/heads/master@{#434090}
diff --git a/ui/android/dummy_screen_android.cc b/ui/android/dummy_screen_android.cc
new file mode 100644
index 0000000..28520b8a
--- /dev/null
+++ b/ui/android/dummy_screen_android.cc
@@ -0,0 +1,67 @@
+// 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.
+
+#include "ui/android/dummy_screen_android.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
+
+namespace ui {
+
+using display::Display;
+using display::DisplayObserver;
+
+// A Screen for Android unit tests that do not talk to Java. The class contains
+// one primary display with default Display configuration and 256x512 dip size.
+class DummyScreenAndroid : public display::Screen {
+ public:
+  DummyScreenAndroid() {
+    const int display_id = 0;
+    const gfx::Rect bounds_in_dip(256, 512);
+    displays_.push_back(Display(display_id, bounds_in_dip));
+  }
+
+  ~DummyScreenAndroid() override {}
+
+  // Screen interface.
+
+  gfx::Point GetCursorScreenPoint() override { return gfx::Point(); }
+
+  bool IsWindowUnderCursor(gfx::NativeWindow window) override { return false; }
+
+  gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override {
+    return NULL;
+  }
+
+  int GetNumDisplays() const override { return 1; }
+
+  const std::vector<Display>& GetAllDisplays() const override {
+    return displays_;
+  }
+
+  Display GetDisplayNearestWindow(gfx::NativeView view) const override {
+    return GetPrimaryDisplay();
+  }
+
+  Display GetDisplayNearestPoint(const gfx::Point& point) const override {
+    return GetPrimaryDisplay();
+  }
+
+  Display GetDisplayMatching(const gfx::Rect& match_rect) const override {
+    return GetPrimaryDisplay();
+  }
+
+  Display GetPrimaryDisplay() const override { return displays_[0]; }
+
+  void AddObserver(DisplayObserver* observer) override {}
+  void RemoveObserver(DisplayObserver* observer) override {}
+
+ private:
+  std::vector<Display> displays_;
+};
+
+display::Screen* CreateDummyScreenAndroid() {
+  return new DummyScreenAndroid;
+}
+
+}  // namespace ui