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

Side by Side Diff: ash/wm/lock_state_controller.cc

Issue 2319783002: mash: Allow a subset of D-Bus clients to be created in DBusThreadManager (Closed)
Patch Set: WIP, add DBusThreadManagerAsh and DBusThreadManagerChrome Created 4 years, 3 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 | « ash/test/ash_test_helper.cc ('k') | ash/wm/power_button_controller.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/wm/lock_state_controller.h" 5 #include "ash/wm/lock_state_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "ash/cancel_mode.h" 11 #include "ash/cancel_mode.h"
12 #include "ash/common/accessibility_delegate.h" 12 #include "ash/common/accessibility_delegate.h"
13 #include "ash/common/ash_switches.h" 13 #include "ash/common/ash_switches.h"
14 #include "ash/common/dbus_thread_manager_ash.h"
14 #include "ash/common/shell_delegate.h" 15 #include "ash/common/shell_delegate.h"
15 #include "ash/common/shell_window_ids.h" 16 #include "ash/common/shell_window_ids.h"
16 #include "ash/common/wm_shell.h" 17 #include "ash/common/wm_shell.h"
17 #include "ash/shell.h" 18 #include "ash/shell.h"
18 #include "ash/wm/session_state_animator.h" 19 #include "ash/wm/session_state_animator.h"
19 #include "ash/wm/session_state_animator_impl.h" 20 #include "ash/wm/session_state_animator_impl.h"
20 #include "base/bind.h" 21 #include "base/bind.h"
21 #include "base/bind_helpers.h" 22 #include "base/bind_helpers.h"
22 #include "base/command_line.h" 23 #include "base/command_line.h"
23 #include "base/location.h" 24 #include "base/location.h"
24 #include "base/logging.h" 25 #include "base/logging.h"
25 #include "base/metrics/histogram_macros.h" 26 #include "base/metrics/histogram_macros.h"
26 #include "base/strings/string_util.h" 27 #include "base/strings/string_util.h"
27 #include "base/timer/timer.h" 28 #include "base/timer/timer.h"
28 #include "ui/aura/window_tree_host.h" 29 #include "ui/aura/window_tree_host.h"
29 #include "ui/views/controls/menu/menu_controller.h" 30 #include "ui/views/controls/menu/menu_controller.h"
30 #include "ui/wm/core/compound_event_filter.h" 31 #include "ui/wm/core/compound_event_filter.h"
31 32
32 #if defined(OS_CHROMEOS) 33 #if defined(OS_CHROMEOS)
33 #include "base/sys_info.h" 34 #include "base/sys_info.h"
34 #include "chromeos/dbus/dbus_thread_manager.h" 35 // #include "chromeos/dbus/dbus_thread_manager.h"
35 #include "chromeos/dbus/session_manager_client.h" 36 #include "chromeos/dbus/session_manager_client.h"
36 #endif 37 #endif
37 38
38 #define UMA_HISTOGRAM_LOCK_TIMES(name, sample) \ 39 #define UMA_HISTOGRAM_LOCK_TIMES(name, sample) \
39 UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, \ 40 UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, \
40 base::TimeDelta::FromMilliseconds(1), \ 41 base::TimeDelta::FromMilliseconds(1), \
41 base::TimeDelta::FromSeconds(50), 100) 42 base::TimeDelta::FromSeconds(50), 100)
42 43
43 namespace ash { 44 namespace ash {
44 45
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 DCHECK(!request_lock) << "Got request to lock already-locked system " 486 DCHECK(!request_lock) << "Got request to lock already-locked system "
486 << "at completion of pre-lock animation"; 487 << "at completion of pre-lock animation";
487 return; 488 return;
488 } 489 }
489 490
490 if (request_lock) { 491 if (request_lock) {
491 WmShell::Get()->RecordUserMetricsAction( 492 WmShell::Get()->RecordUserMetricsAction(
492 shutdown_after_lock_ ? UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON 493 shutdown_after_lock_ ? UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON
493 : UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON); 494 : UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON);
494 #if defined(OS_CHROMEOS) 495 #if defined(OS_CHROMEOS)
495 chromeos::DBusThreadManager::Get() 496 DBusThreadManagerAsh::Get()
496 ->GetSessionManagerClient() 497 ->GetSessionManagerClient()
497 ->RequestLockScreen(); 498 ->RequestLockScreen();
498 #endif 499 #endif
499 } 500 }
500 501
501 base::TimeDelta timeout = 502 base::TimeDelta timeout =
502 base::TimeDelta::FromMilliseconds(kLockFailTimeoutMs); 503 base::TimeDelta::FromMilliseconds(kLockFailTimeoutMs);
503 #if defined(OS_CHROMEOS) 504 #if defined(OS_CHROMEOS)
504 // Increase lock timeout for slower hardware, see http://crbug.com/350628 505 // Increase lock timeout for slower hardware, see http://crbug.com/350628
505 const std::string board = base::SysInfo::GetLsbReleaseBoard(); 506 const std::string board = base::SysInfo::GetLsbReleaseBoard();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 SessionStateAnimator::AnimationSpeed speed, 578 SessionStateAnimator::AnimationSpeed speed,
578 SessionStateAnimator::AnimationSequence* animation_sequence) { 579 SessionStateAnimator::AnimationSequence* animation_sequence) {
579 if (unlocked_properties_.get() && unlocked_properties_->wallpaper_is_hidden) { 580 if (unlocked_properties_.get() && unlocked_properties_->wallpaper_is_hidden) {
580 animation_sequence->StartAnimation(SessionStateAnimator::WALLPAPER, 581 animation_sequence->StartAnimation(SessionStateAnimator::WALLPAPER,
581 SessionStateAnimator::ANIMATION_FADE_OUT, 582 SessionStateAnimator::ANIMATION_FADE_OUT,
582 speed); 583 speed);
583 } 584 }
584 } 585 }
585 586
586 } // namespace ash 587 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_helper.cc ('k') | ash/wm/power_button_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698