diff options
author | scottmg <scottmg@chromium.org> | 2016-01-26 17:30:36 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-27 01:31:58 +0000 |
commit | fb33c340bd50b0e8a5c874e5d7c10a6361cee126 (patch) | |
tree | bb7a28d9d333accda14d8cbce5d9c6e7b4f51698 /extensions | |
parent | bfe14dd182c7c660eb27265dfeec462768af2422 (diff) | |
download | chromium_src-fb33c340bd50b0e8a5c874e5d7c10a6361cee126.zip chromium_src-fb33c340bd50b0e8a5c874e5d7c10a6361cee126.tar.gz chromium_src-fb33c340bd50b0e8a5c874e5d7c10a6361cee126.tar.bz2 |
Remove ui/gfx/screen_type_delegate.h
This removes gfx::SCREEN_TYPE_NATIVE/SCREEN_TYPE_ALTERNATE, and there is
now only one Screen instance. It's still a runtime-installed thing for
test purposes.
TBR=various owners for trivial changes
R=oshima@chromium.org, sky@chromium.org
BUG=558054
Review URL: https://codereview.chromium.org/1608733002
Cr-Commit-Position: refs/heads/master@{#371676}
Diffstat (limited to 'extensions')
6 files changed, 10 insertions, 13 deletions
diff --git a/extensions/browser/api/capture_web_contents_function.cc b/extensions/browser/api/capture_web_contents_function.cc index e10842d..77c8a3e 100644 --- a/extensions/browser/api/capture_web_contents_function.cc +++ b/extensions/browser/api/capture_web_contents_function.cc @@ -78,7 +78,7 @@ bool CaptureWebContentsFunction::RunAsync() { const gfx::Size view_size = view->GetViewBounds().size(); gfx::Size bitmap_size = view_size; const gfx::NativeView native_view = view->GetNativeView(); - gfx::Screen* const screen = gfx::Screen::GetScreenFor(native_view); + gfx::Screen* const screen = gfx::Screen::GetScreen(); const float scale = screen->GetDisplayNearestWindow(native_view).device_scale_factor(); if (scale > 1.0f) diff --git a/extensions/browser/api/system_display/display_info_provider.cc b/extensions/browser/api/system_display/display_info_provider.cc index b49949b..df7b26a 100644 --- a/extensions/browser/api/system_display/display_info_provider.cc +++ b/extensions/browser/api/system_display/display_info_provider.cc @@ -77,8 +77,7 @@ DisplayInfoProvider::CreateDisplayUnitInfo(const gfx::Display& display, void DisplayInfoProvider::EnableUnifiedDesktop(bool enable) {} DisplayInfo DisplayInfoProvider::GetAllDisplaysInfo() { - // TODO(scottmg): Native is wrong http://crbug.com/133312 - gfx::Screen* screen = gfx::Screen::GetNativeScreen(); + gfx::Screen* screen = gfx::Screen::GetScreen(); int64_t primary_id = screen->GetPrimaryDisplay().id(); std::vector<gfx::Display> displays = screen->GetAllDisplays(); DisplayInfo all_displays; diff --git a/extensions/browser/api/system_display/system_display_apitest.cc b/extensions/browser/api/system_display/system_display_apitest.cc index 1f3974e..cdcb519 100644 --- a/extensions/browser/api/system_display/system_display_apitest.cc +++ b/extensions/browser/api/system_display/system_display_apitest.cc @@ -142,9 +142,8 @@ class SystemDisplayApiTest : public ShellApiTest { void SetUpOnMainThread() override { ShellApiTest::SetUpOnMainThread(); - ANNOTATE_LEAKING_OBJECT_PTR( - gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)); - gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); + ANNOTATE_LEAKING_OBJECT_PTR(gfx::Screen::GetScreen()); + gfx::Screen::SetScreenInstance(screen_.get()); DisplayInfoProvider::InitializeForTesting(provider_.get()); } diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc index 75d5d40..5881f30 100644 --- a/extensions/browser/app_window/app_window.cc +++ b/extensions/browser/app_window/app_window.cc @@ -851,7 +851,7 @@ void AppWindow::SetNativeWindowFullscreen() { bool AppWindow::IntersectsWithTaskbar() const { #if defined(OS_WIN) - gfx::Screen* screen = gfx::Screen::GetNativeScreen(); + gfx::Screen* screen = gfx::Screen::GetScreen(); gfx::Rect window_bounds = native_app_window_->GetRestoredBounds(); std::vector<gfx::Display> displays = screen->GetAllDisplays(); @@ -1012,7 +1012,7 @@ void AppWindow::SaveWindowPosition() { gfx::Rect bounds = native_app_window_->GetRestoredBounds(); gfx::Rect screen_bounds = - gfx::Screen::GetNativeScreen()->GetDisplayMatching(bounds).work_area(); + gfx::Screen::GetScreen()->GetDisplayMatching(bounds).work_area(); ui::WindowShowState window_state = native_app_window_->GetRestoredState(); cache->SaveGeometry( extension_id(), window_key_, bounds, screen_bounds, window_state); @@ -1078,7 +1078,7 @@ AppWindow::CreateParams AppWindow::LoadDefaults(CreateParams params) &cached_state)) { // App window has cached screen bounds, make sure it fits on screen in // case the screen resolution changed. - gfx::Screen* screen = gfx::Screen::GetNativeScreen(); + gfx::Screen* screen = gfx::Screen::GetScreen(); gfx::Display display = screen->GetDisplayMatching(cached_bounds); gfx::Rect current_screen_bounds = display.work_area(); SizeConstraints constraints(params.GetWindowMinimumSize(gfx::Insets()), diff --git a/extensions/shell/browser/shell_desktop_controller_aura.cc b/extensions/shell/browser/shell_desktop_controller_aura.cc index 9fc1876..18474de 100644 --- a/extensions/shell/browser/shell_desktop_controller_aura.cc +++ b/extensions/shell/browser/shell_desktop_controller_aura.cc @@ -269,8 +269,7 @@ void ShellDesktopControllerAura::InitWindowManager() { cursor_manager_.reset( new wm::CursorManager(scoped_ptr<wm::NativeCursorManager>( new ShellNativeCursorManager(host_.get())))); - cursor_manager_->SetDisplay( - gfx::Screen::GetNativeScreen()->GetPrimaryDisplay()); + cursor_manager_->SetDisplay(gfx::Screen::GetScreen()->GetPrimaryDisplay()); cursor_manager_->SetCursor(ui::kCursorPointer); aura::client::SetCursorClient(host_->window(), cursor_manager_.get()); @@ -298,7 +297,7 @@ void ShellDesktopControllerAura::CreateRootWindow() { size = gfx::Size(1920, 1080); screen_.reset(new ShellScreen(size)); - gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); + gfx::Screen::SetScreenInstance(screen_.get()); // TODO(mukai): Set up input method. host_.reset(screen_->CreateHostForPrimaryDisplay()); diff --git a/extensions/shell/browser/shell_desktop_controller_mac.mm b/extensions/shell/browser/shell_desktop_controller_mac.mm index 9789787..7731b0a 100644 --- a/extensions/shell/browser/shell_desktop_controller_mac.mm +++ b/extensions/shell/browser/shell_desktop_controller_mac.mm @@ -26,7 +26,7 @@ ShellDesktopControllerMac::~ShellDesktopControllerMac() { gfx::Size ShellDesktopControllerMac::GetWindowSize() { // This is the full screen size. - return gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().bounds().size(); + return gfx::Screen::GetScreen()->GetPrimaryDisplay().bounds().size(); } AppWindow* ShellDesktopControllerMac::CreateAppWindow( |