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

Side by Side Diff: media/capture/video/linux/video_capture_device_chromeos.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 unified diff | Download patch
« no previous file with comments | « extensions/shell/browser/shell_desktop_controller_mac.mm ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/capture/video/linux/video_capture_device_chromeos.h" 5 #include "media/capture/video/linux/video_capture_device_chromeos.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void OnDisplayMetricsChanged(const gfx::Display& display, 52 void OnDisplayMetricsChanged(const gfx::Display& display,
53 uint32_t metrics) override { 53 uint32_t metrics) override {
54 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 54 DCHECK(ui_task_runner_->BelongsToCurrentThread());
55 if (!(metrics & DISPLAY_METRIC_ROTATION)) 55 if (!(metrics & DISPLAY_METRIC_ROTATION))
56 return; 56 return;
57 SendDisplayRotation(display); 57 SendDisplayRotation(display);
58 } 58 }
59 59
60 void AddObserverOnUIThread() { 60 void AddObserverOnUIThread() {
61 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 61 DCHECK(ui_task_runner_->BelongsToCurrentThread());
62 gfx::Screen* screen = 62 gfx::Screen* screen = gfx::Screen::GetScreen();
63 gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_ALTERNATE);
64 if (screen) { 63 if (screen) {
65 screen->AddObserver(this); 64 screen->AddObserver(this);
66 SendDisplayRotation(screen->GetPrimaryDisplay()); 65 SendDisplayRotation(screen->GetPrimaryDisplay());
67 } 66 }
68 } 67 }
69 68
70 void RemoveObserverOnUIThread() { 69 void RemoveObserverOnUIThread() {
71 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 70 DCHECK(ui_task_runner_->BelongsToCurrentThread());
72 gfx::Screen* screen = 71 gfx::Screen* screen = gfx::Screen::GetScreen();
73 gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_ALTERNATE);
74 if (screen) 72 if (screen)
75 screen->RemoveObserver(this); 73 screen->RemoveObserver(this);
76 } 74 }
77 75
78 // Post the screen rotation change from the UI thread to capture thread 76 // Post the screen rotation change from the UI thread to capture thread
79 void SendDisplayRotation(const gfx::Display& display) { 77 void SendDisplayRotation(const gfx::Display& display) {
80 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 78 DCHECK(ui_task_runner_->BelongsToCurrentThread());
81 capture_task_runner_->PostTask( 79 capture_task_runner_->PostTask(
82 FROM_HERE, 80 FROM_HERE,
83 base::Bind(&ScreenObserverDelegate::SendDisplayRotationOnCaptureThread, 81 base::Bind(&ScreenObserverDelegate::SendDisplayRotationOnCaptureThread,
(...skipping 24 matching lines...) Expand all
108 screen_observer_delegate_->RemoveObserver(); 106 screen_observer_delegate_->RemoveObserver();
109 } 107 }
110 108
111 void VideoCaptureDeviceChromeOS::SetDisplayRotation( 109 void VideoCaptureDeviceChromeOS::SetDisplayRotation(
112 const gfx::Display& display) { 110 const gfx::Display& display) {
113 if (display.IsInternal()) 111 if (display.IsInternal())
114 SetRotation(display.rotation() * 90); 112 SetRotation(display.rotation() * 90);
115 } 113 }
116 114
117 } // namespace media 115 } // namespace media
OLDNEW
« no previous file with comments | « extensions/shell/browser/shell_desktop_controller_mac.mm ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698