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

Unified Diff: ui/gfx/screen.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 11 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
« no previous file with comments | « ui/gfx/screen.h ('k') | ui/gfx/screen_type_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/screen.cc
diff --git a/ui/gfx/screen.cc b/ui/gfx/screen.cc
index 06ec78ec885b8fee107c72375e4df8174c46c934..27662e782132a70efdcf300e759cf30241f62fec 100644
--- a/ui/gfx/screen.cc
+++ b/ui/gfx/screen.cc
@@ -4,14 +4,12 @@
#include "base/logging.h"
#include "ui/gfx/screen.h"
-#include "ui/gfx/screen_type_delegate.h"
namespace gfx {
namespace {
-Screen* g_screen_[SCREEN_TYPE_LAST + 1];
-ScreenTypeDelegate* g_screen_type_delegate_ = NULL;
+Screen* g_screen;
} // namespace
@@ -22,37 +20,18 @@ Screen::~Screen() {
}
// static
-Screen* Screen::GetScreenFor(NativeView view) {
- ScreenType type = SCREEN_TYPE_NATIVE;
- if (g_screen_type_delegate_)
- type = g_screen_type_delegate_->GetScreenTypeForNativeView(view);
- if (type == SCREEN_TYPE_NATIVE)
- return GetNativeScreen();
- DCHECK(g_screen_[type]);
- return g_screen_[type];
+Screen* Screen::GetScreen() {
+#if defined(OS_MACOSX) || defined(OS_ANDROID)
+ // TODO(scottmg): https://crbug.com/558054
+ if (!g_screen)
+ g_screen = CreateNativeScreen();
+#endif
+ return g_screen;
}
// static
-void Screen::SetScreenInstance(ScreenType type, Screen* instance) {
- DCHECK_LE(type, SCREEN_TYPE_LAST);
- g_screen_[type] = instance;
-}
-
-// static
-Screen* Screen::GetScreenByType(ScreenType type) {
- return g_screen_[type];
-}
-
-// static
-void Screen::SetScreenTypeDelegate(ScreenTypeDelegate* delegate) {
- g_screen_type_delegate_ = delegate;
-}
-
-// static
-Screen* Screen::GetNativeScreen() {
- if (!g_screen_[SCREEN_TYPE_NATIVE])
- g_screen_[SCREEN_TYPE_NATIVE] = CreateNativeScreen();
- return g_screen_[SCREEN_TYPE_NATIVE];
+void Screen::SetScreenInstance(Screen* instance) {
+ g_screen = instance;
}
} // namespace gfx
« no previous file with comments | « ui/gfx/screen.h ('k') | ui/gfx/screen_type_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698