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

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: Remove dependencies of chrome in chromeos. 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
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 MediaCaptureDevicesDispatcher::GetInstance()->AddObserver(this);
586 #endif // defined(OS_CHROMEOS) 587 #endif // defined(OS_CHROMEOS)
587 588
588 #if defined(OS_CHROMEOS) 589 #if defined(OS_CHROMEOS)
589 internal::PowerStatus::Initialize(); 590 internal::PowerStatus::Initialize();
590 #endif 591 #endif
591 } 592 }
592 593
593 Shell::~Shell() { 594 Shell::~Shell() {
594 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); 595 TRACE_EVENT0("shutdown", "ash::Shell::Destructor");
595 596
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 #if defined(OS_CHROMEOS) && defined(USE_X11) 704 #if defined(OS_CHROMEOS) && defined(USE_X11)
704 if (display_change_observer_) 705 if (display_change_observer_)
705 output_configurator_->RemoveObserver(display_change_observer_.get()); 706 output_configurator_->RemoveObserver(display_change_observer_.get());
706 if (output_configurator_animation_) 707 if (output_configurator_animation_)
707 output_configurator_->RemoveObserver(output_configurator_animation_.get()); 708 output_configurator_->RemoveObserver(output_configurator_animation_.get());
708 if (display_error_observer_) 709 if (display_error_observer_)
709 output_configurator_->RemoveObserver(display_error_observer_.get()); 710 output_configurator_->RemoveObserver(display_error_observer_.get());
710 base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow( 711 base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow(
711 output_configurator()); 712 output_configurator());
712 base::MessagePumpX11::Current()->RemoveObserver(output_configurator()); 713 base::MessagePumpX11::Current()->RemoveObserver(output_configurator());
714 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(this);
713 display_change_observer_.reset(); 715 display_change_observer_.reset();
714 #endif // defined(OS_CHROMEOS) 716 #endif // defined(OS_CHROMEOS)
715 717
716 #if defined(OS_CHROMEOS) 718 #if defined(OS_CHROMEOS)
717 internal::PowerStatus::Shutdown(); 719 internal::PowerStatus::Shutdown();
718 #endif 720 #endif
719 721
720 DCHECK(instance_ == this); 722 DCHECK(instance_ == this);
721 instance_ = NULL; 723 instance_ = NULL;
722 } 724 }
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 1031
1030 //////////////////////////////////////////////////////////////////////////////// 1032 ////////////////////////////////////////////////////////////////////////////////
1031 // Shell, aura::client::ActivationChangeObserver implementation: 1033 // Shell, aura::client::ActivationChangeObserver implementation:
1032 1034
1033 void Shell::OnWindowActivated(aura::Window* gained_active, 1035 void Shell::OnWindowActivated(aura::Window* gained_active,
1034 aura::Window* lost_active) { 1036 aura::Window* lost_active) {
1035 if (gained_active) 1037 if (gained_active)
1036 target_root_window_ = gained_active->GetRootWindow(); 1038 target_root_window_ = gained_active->GetRootWindow();
1037 } 1039 }
1038 1040
1041 ////////////////////////////////////////////////////////////////////////////////
1042 // Shell, MediaCaptureDevicesDispatcher::Observer implementation:
1043
1044 void Shell::OnRequestUpdate(int render_process_id,
1045 int render_view_id,
1046 const content::MediaStreamDevice& device,
1047 const content::MediaRequestState state) {
1048 #if defined(OS_CHROMEOS) && defined(USE_X11)
1049 if (device.type == content::MEDIA_TAB_VIDEO_CAPTURE ||
1050 device.type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) {
1051 if (state == content::MEDIA_REQUEST_STATE_DONE) {
1052 output_configurator_->OnScreenSharingChanged(true);
1053 } else if (state == content::MEDIA_REQUEST_STATE_CLOSING) {
1054 output_configurator_->OnScreenSharingChanged(false);
1055 }
1056 }
1057 #endif
1058 }
1059
1039 } // namespace ash 1060 } // namespace ash
OLDNEW
« ash/DEPS ('K') | « ash/shell.h ('k') | chromeos/display/output_configurator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698