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

Side by Side Diff: ash/display/projecting_observer_chromeos.cc

Issue 2613493002: Fix namespace for src/ui/display/. (Closed)
Patch Set: Rebase. Created 3 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
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 "ash/display/projecting_observer_chromeos.h" 5 #include "ash/display/projecting_observer_chromeos.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chromeos/dbus/power_manager_client.h" 8 #include "chromeos/dbus/power_manager_client.h"
9 #include "ui/display/types/display_snapshot.h" 9 #include "ui/display/types/display_snapshot.h"
10 10
11 namespace ash { 11 namespace ash {
12 12
13 ProjectingObserver::ProjectingObserver( 13 ProjectingObserver::ProjectingObserver(
14 chromeos::PowerManagerClient* power_manager_client) 14 chromeos::PowerManagerClient* power_manager_client)
15 : has_internal_output_(false), 15 : has_internal_output_(false),
16 output_count_(0), 16 output_count_(0),
17 casting_session_count_(0), 17 casting_session_count_(0),
18 power_manager_client_(power_manager_client) { 18 power_manager_client_(power_manager_client) {
19 DCHECK(power_manager_client); 19 DCHECK(power_manager_client);
20 } 20 }
21 21
22 ProjectingObserver::~ProjectingObserver() {} 22 ProjectingObserver::~ProjectingObserver() {}
23 23
24 void ProjectingObserver::OnDisplayModeChanged( 24 void ProjectingObserver::OnDisplayModeChanged(
25 const ui::DisplayConfigurator::DisplayStateList& display_states) { 25 const display::DisplayConfigurator::DisplayStateList& display_states) {
26 has_internal_output_ = false; 26 has_internal_output_ = false;
27 output_count_ = display_states.size(); 27 output_count_ = display_states.size();
28 28
29 for (size_t i = 0; i < display_states.size(); ++i) { 29 for (size_t i = 0; i < display_states.size(); ++i) {
30 if (display_states[i]->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL) { 30 if (display_states[i]->type() ==
31 display::DISPLAY_CONNECTION_TYPE_INTERNAL) {
31 has_internal_output_ = true; 32 has_internal_output_ = true;
32 break; 33 break;
33 } 34 }
34 } 35 }
35 36
36 SetIsProjecting(); 37 SetIsProjecting();
37 } 38 }
38 39
39 void ProjectingObserver::OnCastingSessionStartedOrStopped(bool started) { 40 void ProjectingObserver::OnCastingSessionStartedOrStopped(bool started) {
40 if (started) { 41 if (started) {
(...skipping 11 matching lines...) Expand all
52 void ProjectingObserver::SetIsProjecting() { 53 void ProjectingObserver::SetIsProjecting() {
53 // "Projecting" is defined as having more than 1 output connected while at 54 // "Projecting" is defined as having more than 1 output connected while at
54 // least one of them is an internal output. 55 // least one of them is an internal output.
55 bool projecting = 56 bool projecting =
56 has_internal_output_ && (output_count_ + casting_session_count_ > 1); 57 has_internal_output_ && (output_count_ + casting_session_count_ > 1);
57 58
58 power_manager_client_->SetIsProjecting(projecting); 59 power_manager_client_->SetIsProjecting(projecting);
59 } 60 }
60 61
61 } // namespace ash 62 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/projecting_observer_chromeos.h ('k') | ash/display/projecting_observer_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698