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

Side by Side Diff: ash/shell.cc

Issue 139053003: Chrome OS: avoid suspending on lid close when casting is active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments and add unit test. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chromeos/DEPS » ('j') | chromeos/DEPS » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "ash/accelerators/accelerator_controller.h" 10 #include "ash/accelerators/accelerator_controller.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 gpu::GPU_FEATURE_TYPE_PANEL_FITTING); 576 gpu::GPU_FEATURE_TYPE_PANEL_FITTING);
577 577
578 output_configurator_->Init(!is_panel_fitting_disabled); 578 output_configurator_->Init(!is_panel_fitting_disabled);
579 user_metrics_recorder_.reset(new UserMetricsRecorder); 579 user_metrics_recorder_.reset(new UserMetricsRecorder);
580 580
581 base::MessagePumpX11::Current()->AddDispatcherForRootWindow( 581 base::MessagePumpX11::Current()->AddDispatcherForRootWindow(
582 output_configurator()); 582 output_configurator());
583 // We can't do this with a root window listener because XI_HierarchyChanged 583 // We can't do this with a root window listener because XI_HierarchyChanged
584 // messages don't have a target window. 584 // messages don't have a target window.
585 base::MessagePumpX11::Current()->AddObserver(output_configurator()); 585 base::MessagePumpX11::Current()->AddObserver(output_configurator());
586
587 MediaCaptureDevicesDispatcher::GetInstance()->AddObserver(
588 output_configurator());
586 #endif // defined(OS_CHROMEOS) 589 #endif // defined(OS_CHROMEOS)
587 590
588 #if defined(OS_CHROMEOS) 591 #if defined(OS_CHROMEOS)
589 internal::PowerStatus::Initialize(); 592 internal::PowerStatus::Initialize();
590 #endif 593 #endif
591 } 594 }
592 595
593 Shell::~Shell() { 596 Shell::~Shell() {
594 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); 597 TRACE_EVENT0("shutdown", "ash::Shell::Destructor");
595 598
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 #if defined(OS_CHROMEOS) && defined(USE_X11) 706 #if defined(OS_CHROMEOS) && defined(USE_X11)
704 if (display_change_observer_) 707 if (display_change_observer_)
705 output_configurator_->RemoveObserver(display_change_observer_.get()); 708 output_configurator_->RemoveObserver(display_change_observer_.get());
706 if (output_configurator_animation_) 709 if (output_configurator_animation_)
707 output_configurator_->RemoveObserver(output_configurator_animation_.get()); 710 output_configurator_->RemoveObserver(output_configurator_animation_.get());
708 if (display_error_observer_) 711 if (display_error_observer_)
709 output_configurator_->RemoveObserver(display_error_observer_.get()); 712 output_configurator_->RemoveObserver(display_error_observer_.get());
710 base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow( 713 base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow(
711 output_configurator()); 714 output_configurator());
712 base::MessagePumpX11::Current()->RemoveObserver(output_configurator()); 715 base::MessagePumpX11::Current()->RemoveObserver(output_configurator());
716 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(
717 output_configurator());
713 display_change_observer_.reset(); 718 display_change_observer_.reset();
714 #endif // defined(OS_CHROMEOS) 719 #endif // defined(OS_CHROMEOS)
715 720
716 #if defined(OS_CHROMEOS) 721 #if defined(OS_CHROMEOS)
717 internal::PowerStatus::Shutdown(); 722 internal::PowerStatus::Shutdown();
718 #endif 723 #endif
719 724
720 DCHECK(instance_ == this); 725 DCHECK(instance_ == this);
721 instance_ = NULL; 726 instance_ = NULL;
722 } 727 }
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 //////////////////////////////////////////////////////////////////////////////// 1035 ////////////////////////////////////////////////////////////////////////////////
1031 // Shell, aura::client::ActivationChangeObserver implementation: 1036 // Shell, aura::client::ActivationChangeObserver implementation:
1032 1037
1033 void Shell::OnWindowActivated(aura::Window* gained_active, 1038 void Shell::OnWindowActivated(aura::Window* gained_active,
1034 aura::Window* lost_active) { 1039 aura::Window* lost_active) {
1035 if (gained_active) 1040 if (gained_active)
1036 target_root_window_ = gained_active->GetRootWindow(); 1041 target_root_window_ = gained_active->GetRootWindow();
1037 } 1042 }
1038 1043
1039 } // namespace ash 1044 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chromeos/DEPS » ('j') | chromeos/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698