Shell::GetInstance() -> Shell::Get()
GetInstance() is so 2011.
BUG=none
TEST=none
[email protected], [email protected], [email protected]
[email protected], [email protected], [email protected]
Review-Url: https://codereview.chromium.org/2797413002
Cr-Commit-Position: refs/heads/master@{#462537}
diff --git a/ash/accelerators/accelerator_commands_aura.cc b/ash/accelerators/accelerator_commands_aura.cc
index 88ad889..241d449 100644
--- a/ash/accelerators/accelerator_commands_aura.cc
+++ b/ash/accelerators/accelerator_commands_aura.cc
@@ -17,13 +17,12 @@
void ToggleTouchHudProjection() {
base::RecordAction(base::UserMetricsAction("Accel_Touch_Hud_Clear"));
- bool enabled = Shell::GetInstance()->is_touch_hud_projection_enabled();
- Shell::GetInstance()->SetTouchHudProjectionEnabled(!enabled);
+ bool enabled = Shell::Get()->is_touch_hud_projection_enabled();
+ Shell::Get()->SetTouchHudProjectionEnabled(!enabled);
}
bool IsInternalDisplayZoomEnabled() {
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
return display_manager->IsDisplayUIScalingEnabled() ||
display_manager->IsInUnifiedMode();
}
@@ -34,21 +33,19 @@
else
base::RecordAction(base::UserMetricsAction("Accel_Scale_Ui_Down"));
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
return display_manager->ZoomInternalDisplay(up);
}
void ResetInternalDisplayZoom() {
base::RecordAction(base::UserMetricsAction("Accel_Scale_Ui_Reset"));
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
display_manager->ResetInternalDisplayZoom();
}
void Unpin() {
WmWindow* pinned_window =
- Shell::GetInstance()->screen_pinning_controller()->pinned_window();
+ Shell::Get()->screen_pinning_controller()->pinned_window();
if (pinned_window)
pinned_window->GetWindowState()->Restore();
}
diff --git a/ash/accelerators/accelerator_controller_delegate_aura.cc b/ash/accelerators/accelerator_controller_delegate_aura.cc
index 294ab8d..00d7f421 100644
--- a/ash/accelerators/accelerator_controller_delegate_aura.cc
+++ b/ash/accelerators/accelerator_controller_delegate_aura.cc
@@ -47,21 +47,21 @@
using base::UserMetricsAction;
bool CanHandleMagnifyScreen() {
- return Shell::GetInstance()->magnification_controller()->IsEnabled();
+ return Shell::Get()->magnification_controller()->IsEnabled();
}
// Magnify the screen
void HandleMagnifyScreen(int delta_index) {
- if (Shell::GetInstance()->magnification_controller()->IsEnabled()) {
+ if (Shell::Get()->magnification_controller()->IsEnabled()) {
// TODO(yoshiki): Move the following logic to MagnificationController.
- float scale = Shell::GetInstance()->magnification_controller()->GetScale();
+ float scale = Shell::Get()->magnification_controller()->GetScale();
// Calculate rounded logarithm (base kMagnificationScaleFactor) of scale.
int scale_index =
std::floor(std::log(scale) / std::log(kMagnificationScaleFactor) + 0.5);
int new_scale_index = std::max(0, std::min(8, scale_index + delta_index));
- Shell::GetInstance()->magnification_controller()->SetScale(
+ Shell::Get()->magnification_controller()->SetScale(
std::pow(kMagnificationScaleFactor, new_scale_index), true);
}
}
@@ -83,7 +83,7 @@
// Rotates the screen.
void HandleRotateScreen() {
- if (Shell::GetInstance()->display_manager()->IsInUnifiedMode())
+ if (Shell::Get()->display_manager()->IsInUnifiedMode())
return;
base::RecordAction(UserMetricsAction("Accel_Rotate_Screen"));
@@ -91,8 +91,8 @@
display::Display display =
display::Screen::GetScreen()->GetDisplayNearestPoint(point);
const display::ManagedDisplayInfo& display_info =
- Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id());
- Shell::GetInstance()->display_configuration_controller()->SetDisplayRotation(
+ Shell::Get()->display_manager()->GetDisplayInfo(display.id());
+ Shell::Get()->display_configuration_controller()->SetDisplayRotation(
display.id(), GetNextRotation(display_info.GetActiveRotation()),
display::Display::ROTATION_SOURCE_USER);
}
@@ -100,14 +100,14 @@
void HandleTakeWindowScreenshot(ScreenshotDelegate* screenshot_delegate) {
base::RecordAction(UserMetricsAction("Accel_Take_Window_Screenshot"));
DCHECK(screenshot_delegate);
- Shell::GetInstance()->screenshot_controller()->StartWindowScreenshotSession(
+ Shell::Get()->screenshot_controller()->StartWindowScreenshotSession(
screenshot_delegate);
}
void HandleTakePartialScreenshot(ScreenshotDelegate* screenshot_delegate) {
base::RecordAction(UserMetricsAction("Accel_Take_Partial_Screenshot"));
DCHECK(screenshot_delegate);
- Shell::GetInstance()->screenshot_controller()->StartPartialScreenshotSession(
+ Shell::Get()->screenshot_controller()->StartPartialScreenshotSession(
screenshot_delegate, true /* draw_overlay_immediately */);
}
@@ -132,15 +132,14 @@
// TODO(rjkroege): This is not correct behaviour on devices with more than
// two screens. Behave the same as mirroring: fail and notify if there are
// three or more screens.
- Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId(
- Shell::GetInstance()->display_manager()->GetSecondaryDisplay().id());
+ Shell::Get()->display_configuration_controller()->SetPrimaryDisplayId(
+ Shell::Get()->display_manager()->GetSecondaryDisplay().id());
}
void HandleToggleMirrorMode() {
base::RecordAction(UserMetricsAction("Accel_Toggle_Mirror_Mode"));
- bool mirror = !Shell::GetInstance()->display_manager()->IsInMirrorMode();
- Shell::GetInstance()->display_configuration_controller()->SetMirrorMode(
- mirror);
+ bool mirror = !Shell::Get()->display_manager()->IsInMirrorMode();
+ Shell::Get()->display_configuration_controller()->SetMirrorMode(mirror);
}
bool CanHandleTouchHud() {
@@ -263,7 +262,7 @@
const ui::Accelerator& accelerator) {
switch (action) {
case DEBUG_TOGGLE_DEVICE_SCALE_FACTOR:
- Shell::GetInstance()->display_manager()->ToggleDisplayScaleFactor();
+ Shell::Get()->display_manager()->ToggleDisplayScaleFactor();
break;
case DEBUG_TOGGLE_SHOW_DEBUG_BORDERS:
debug::ToggleShowDebugBorders();
@@ -275,18 +274,18 @@
debug::ToggleShowPaintRects();
break;
case DEV_ADD_REMOVE_DISPLAY:
- Shell::GetInstance()->display_manager()->AddRemoveDisplay();
+ Shell::Get()->display_manager()->AddRemoveDisplay();
break;
case DEV_TOGGLE_ROOT_WINDOW_FULL_SCREEN:
Shell::GetPrimaryRootWindowController()->ash_host()->ToggleFullScreen();
break;
case DEV_TOGGLE_UNIFIED_DESKTOP:
- Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(
- !Shell::GetInstance()->display_manager()->unified_desktop_enabled());
+ Shell::Get()->display_manager()->SetUnifiedDesktopEnabled(
+ !Shell::Get()->display_manager()->unified_desktop_enabled());
break;
case LOCK_PRESSED:
case LOCK_RELEASED:
- Shell::GetInstance()->power_button_controller()->OnLockButtonEvent(
+ Shell::Get()->power_button_controller()->OnLockButtonEvent(
action == LOCK_PRESSED, base::TimeTicks());
break;
case MAGNIFY_SCREEN_ZOOM_IN:
@@ -300,7 +299,7 @@
if (!base::SysInfo::IsRunningOnChromeOS()) {
// There is no powerd, the Chrome OS power manager, in linux desktop,
// so call the PowerButtonController here.
- Shell::GetInstance()->power_button_controller()->OnPowerButtonEvent(
+ Shell::Get()->power_button_controller()->OnPowerButtonEvent(
action == POWER_PRESSED, base::TimeTicks());
}
// We don't do anything with these at present on the device,
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index 2a5d178..c5206dad 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -814,8 +814,7 @@
app_list::test::TestAppListPresenter test_app_list_presenter;
Shell::Get()->app_list()->SetAppListPresenter(
test_app_list_presenter.CreateInterfacePtrAndBind());
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
// The press event should not toggle the AppList, the release should instead.
EXPECT_FALSE(
@@ -1030,7 +1029,7 @@
// test::AshTestBase:
void SetUp() override {
AshTestBase::SetUp();
- Shell::GetInstance()->lock_state_controller()->set_animator_for_test(
+ Shell::Get()->lock_state_controller()->set_animator_for_test(
new test::TestSessionStateAnimator);
}
@@ -1058,7 +1057,7 @@
// Power key (reserved) should always be handled.
test::LockStateControllerTestApi test_api(
- Shell::GetInstance()->lock_state_controller());
+ Shell::Get()->lock_state_controller());
EXPECT_FALSE(test_api.is_animating_lock());
generator.PressKey(ui::VKEY_POWER, ui::EF_NONE);
EXPECT_TRUE(test_api.is_animating_lock());
@@ -1110,7 +1109,7 @@
// Power key (reserved) should always be handled.
test::LockStateControllerTestApi test_api(
- Shell::GetInstance()->lock_state_controller());
+ Shell::Get()->lock_state_controller());
EXPECT_FALSE(test_api.is_animating_lock());
generator.PressKey(ui::VKEY_POWER, ui::EF_NONE);
EXPECT_TRUE(test_api.is_animating_lock());
@@ -1228,8 +1227,7 @@
}
TEST_F(AcceleratorControllerTest, DisallowedWithNoWindow) {
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) {
delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE);
diff --git a/ash/accelerators/accelerator_interactive_uitest_chromeos.cc b/ash/accelerators/accelerator_interactive_uitest_chromeos.cc
index 48ca2b9..99068b4 100644
--- a/ash/accelerators/accelerator_interactive_uitest_chromeos.cc
+++ b/ash/accelerators/accelerator_interactive_uitest_chromeos.cc
@@ -60,7 +60,7 @@
void SetUp() override {
AshInteractiveUITestBase::SetUp();
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
chromeos::NetworkHandler::Initialize();
}
@@ -68,7 +68,7 @@
void TearDown() override {
chromeos::NetworkHandler::Shutdown();
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
AshInteractiveUITestBase::TearDown();
}
diff --git a/ash/accelerators/magnifier_key_scroller.cc b/ash/accelerators/magnifier_key_scroller.cc
index 342edbe..d5565ea 100644
--- a/ash/accelerators/magnifier_key_scroller.cc
+++ b/ash/accelerators/magnifier_key_scroller.cc
@@ -24,7 +24,7 @@
switches::kAshEnableMagnifierKeyScroller);
return (magnifier_key_scroller_enabled || has_switch) &&
- ash::Shell::GetInstance()->magnification_controller()->IsEnabled();
+ ash::Shell::Get()->magnification_controller()->IsEnabled();
}
// static
@@ -58,7 +58,7 @@
void MagnifierKeyScroller::OnKeyHold(const ui::KeyEvent* event) {
MagnificationController* controller =
- Shell::GetInstance()->magnification_controller();
+ Shell::Get()->magnification_controller();
switch (event->key_code()) {
case ui::VKEY_UP:
controller->SetScrollDirection(MagnificationController::SCROLL_UP);
@@ -79,7 +79,7 @@
void MagnifierKeyScroller::OnKeyUnhold(const ui::KeyEvent* event) {
MagnificationController* controller =
- Shell::GetInstance()->magnification_controller();
+ Shell::Get()->magnification_controller();
controller->SetScrollDirection(MagnificationController::SCROLL_NONE);
}
diff --git a/ash/accelerators/magnifier_key_scroller_unittest.cc b/ash/accelerators/magnifier_key_scroller_unittest.cc
index 15439ae..b886bf9d5 100644
--- a/ash/accelerators/magnifier_key_scroller_unittest.cc
+++ b/ash/accelerators/magnifier_key_scroller_unittest.cc
@@ -46,8 +46,8 @@
wm::ActivateWindow(window.get());
MagnifierKeyScroller::ScopedEnablerForTest scoped;
- Shell* shell = Shell::GetInstance();
- MagnificationController* controller = shell->magnification_controller();
+ MagnificationController* controller =
+ Shell::Get()->magnification_controller();
controller->SetEnabled(true);
EXPECT_EQ("200,150", controller->GetWindowPosition().ToString());
diff --git a/ash/accelerators/spoken_feedback_toggler.cc b/ash/accelerators/spoken_feedback_toggler.cc
index 942208a..3a052ca 100644
--- a/ash/accelerators/spoken_feedback_toggler.cc
+++ b/ash/accelerators/spoken_feedback_toggler.cc
@@ -53,7 +53,7 @@
void SpokenFeedbackToggler::OnKeyHold(const ui::KeyEvent* event) {
if (!toggled_) {
toggled_ = true;
- Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback(
+ Shell::Get()->accessibility_delegate()->ToggleSpokenFeedback(
A11Y_NOTIFICATION_SHOW);
}
}
diff --git a/ash/accelerators/spoken_feedback_toggler_unittest.cc b/ash/accelerators/spoken_feedback_toggler_unittest.cc
index 6835fa3..29be01c 100644
--- a/ash/accelerators/spoken_feedback_toggler_unittest.cc
+++ b/ash/accelerators/spoken_feedback_toggler_unittest.cc
@@ -17,8 +17,7 @@
TEST_F(SpokenFeedbackTogglerTest, Basic) {
SpokenFeedbackToggler::ScopedEnablerForTest scoped;
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
ui::test::EventGenerator& generator = GetEventGenerator();
EXPECT_FALSE(delegate->IsSpokenFeedbackEnabled());
diff --git a/ash/app_list/app_list_presenter_delegate.cc b/ash/app_list/app_list_presenter_delegate.cc
index a425ee5..cfc805f0 100644
--- a/ash/app_list/app_list_presenter_delegate.cc
+++ b/ash/app_list/app_list_presenter_delegate.cc
@@ -66,7 +66,7 @@
app_list::AppListPresenterImpl* presenter,
app_list::AppListViewDelegateFactory* view_delegate_factory)
: presenter_(presenter), view_delegate_factory_(view_delegate_factory) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
AppListPresenterDelegate::~AppListPresenterDelegate() {
@@ -75,10 +75,10 @@
keyboard::KeyboardController::GetInstance();
if (keyboard_controller)
keyboard_controller->RemoveObserver(this);
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
WmWindow* window = WmWindow::Get(view_->GetWidget()->GetNativeWindow());
window->GetRootWindowController()->GetShelf()->RemoveObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
app_list::AppListViewDelegate* AppListPresenterDelegate::GetViewDelegate() {
@@ -108,7 +108,7 @@
keyboard::KeyboardController::GetInstance();
if (keyboard_controller)
keyboard_controller->AddObserver(this);
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
WmShelf* shelf = WmShelf::ForWindow(wm_root_window);
shelf->AddObserver(this);
diff --git a/ash/ash_touch_exploration_manager_chromeos.cc b/ash/ash_touch_exploration_manager_chromeos.cc
index cfbdf23..9603980 100644
--- a/ash/ash_touch_exploration_manager_chromeos.cc
+++ b/ash/ash_touch_exploration_manager_chromeos.cc
@@ -30,7 +30,7 @@
base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kEnableChromeVoxArcSupport)) {
Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this);
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
display::Screen::GetScreen()->AddObserver(this);
UpdateTouchExplorationState();
}
@@ -40,7 +40,7 @@
Shell::Get()->system_tray_notifier();
if (system_tray_notifier)
system_tray_notifier->RemoveAccessibilityObserver(this);
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
display::Screen::GetScreen()->RemoveObserver(this);
}
@@ -62,8 +62,8 @@
}
void AshTouchExplorationManager::SilenceSpokenFeedback() {
- if (Shell::GetInstance()->accessibility_delegate()->IsSpokenFeedbackEnabled())
- Shell::GetInstance()->accessibility_delegate()->SilenceSpokenFeedback();
+ if (Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled())
+ Shell::Get()->accessibility_delegate()->SilenceSpokenFeedback();
}
void AshTouchExplorationManager::PlayVolumeAdjustEarcon() {
@@ -71,30 +71,29 @@
return;
if (!audio_handler_->IsOutputMuted() &&
audio_handler_->GetOutputVolumePercent() != 100) {
- Shell::GetInstance()->accessibility_delegate()->PlayEarcon(
+ Shell::Get()->accessibility_delegate()->PlayEarcon(
chromeos::SOUND_VOLUME_ADJUST);
}
}
void AshTouchExplorationManager::PlayPassthroughEarcon() {
- Shell::GetInstance()->accessibility_delegate()->PlayEarcon(
+ Shell::Get()->accessibility_delegate()->PlayEarcon(
chromeos::SOUND_PASSTHROUGH);
}
void AshTouchExplorationManager::PlayExitScreenEarcon() {
- Shell::GetInstance()->accessibility_delegate()->PlayEarcon(
+ Shell::Get()->accessibility_delegate()->PlayEarcon(
chromeos::SOUND_EXIT_SCREEN);
}
void AshTouchExplorationManager::PlayEnterScreenEarcon() {
- Shell::GetInstance()->accessibility_delegate()->PlayEarcon(
+ Shell::Get()->accessibility_delegate()->PlayEarcon(
chromeos::SOUND_ENTER_SCREEN);
}
void AshTouchExplorationManager::HandleAccessibilityGesture(
ui::AXGesture gesture) {
- Shell::GetInstance()->accessibility_delegate()->HandleAccessibilityGesture(
- gesture);
+ Shell::Get()->accessibility_delegate()->HandleAccessibilityGesture(gesture);
}
void AshTouchExplorationManager::OnDisplayMetricsChanged(
@@ -107,15 +106,13 @@
void AshTouchExplorationManager::PlaySpokenFeedbackToggleCountdown(
int tick_count) {
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
if (delegate->ShouldToggleSpokenFeedbackViaTouch())
delegate->PlaySpokenFeedbackToggleCountdown(tick_count);
}
void AshTouchExplorationManager::ToggleSpokenFeedback() {
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
if (delegate->ShouldToggleSpokenFeedbackViaTouch())
delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_SHOW);
}
@@ -144,7 +141,7 @@
!enable_chromevox_arc_support_;
const bool spoken_feedback_enabled =
- Shell::GetInstance()->accessibility_delegate()->IsSpokenFeedbackEnabled();
+ Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled();
if (!touch_accessibility_enabler_) {
// Always enable gesture to toggle spoken feedback.
@@ -165,7 +162,7 @@
.work_area();
touch_exploration_controller_->SetExcludeBounds(work_area);
SilenceSpokenFeedback();
- Shell::GetInstance()->accessibility_delegate()->ClearFocusHighlight();
+ Shell::Get()->accessibility_delegate()->ClearFocusHighlight();
} else {
touch_exploration_controller_->SetExcludeBounds(gfx::Rect());
}
diff --git a/ash/aura/key_event_watcher_aura.cc b/ash/aura/key_event_watcher_aura.cc
index 66a8a8d..332c3ee 100644
--- a/ash/aura/key_event_watcher_aura.cc
+++ b/ash/aura/key_event_watcher_aura.cc
@@ -10,11 +10,11 @@
namespace ash {
KeyEventWatcherAura::KeyEventWatcherAura() {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
}
KeyEventWatcherAura::~KeyEventWatcherAura() {
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
void KeyEventWatcherAura::OnKeyEvent(ui::KeyEvent* event) {
diff --git a/ash/aura/pointer_watcher_adapter.cc b/ash/aura/pointer_watcher_adapter.cc
index c9e54ca..b965668 100644
--- a/ash/aura/pointer_watcher_adapter.cc
+++ b/ash/aura/pointer_watcher_adapter.cc
@@ -17,11 +17,11 @@
namespace ash {
PointerWatcherAdapter::PointerWatcherAdapter() {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
}
PointerWatcherAdapter::~PointerWatcherAdapter() {
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
void PointerWatcherAdapter::AddPointerWatcher(
diff --git a/ash/aura/wm_shell_aura.cc b/ash/aura/wm_shell_aura.cc
index af9ecb7..fdc12f52 100644
--- a/ash/aura/wm_shell_aura.cc
+++ b/ash/aura/wm_shell_aura.cc
@@ -60,13 +60,13 @@
void WmShellAura::Shutdown() {
if (added_display_observer_)
- Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
+ Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
pointer_watcher_adapter_.reset();
WmShell::Shutdown();
- Shell::GetInstance()->window_tree_host_manager()->Shutdown();
+ Shell::Get()->window_tree_host_manager()->Shutdown();
}
bool WmShellAura::IsRunningInMash() const {
@@ -79,36 +79,34 @@
WmWindow* WmShellAura::GetPrimaryRootWindow() {
return WmWindow::Get(
- Shell::GetInstance()->window_tree_host_manager()->GetPrimaryRootWindow());
+ Shell::Get()->window_tree_host_manager()->GetPrimaryRootWindow());
}
WmWindow* WmShellAura::GetRootWindowForDisplayId(int64_t display_id) {
- return WmWindow::Get(Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display_id));
+ return WmWindow::Get(
+ Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display_id));
}
const display::ManagedDisplayInfo& WmShellAura::GetDisplayInfo(
int64_t display_id) const {
- return Shell::GetInstance()->display_manager()->GetDisplayInfo(display_id);
+ return Shell::Get()->display_manager()->GetDisplayInfo(display_id);
}
bool WmShellAura::IsActiveDisplayId(int64_t display_id) const {
- return Shell::GetInstance()->display_manager()->IsActiveDisplayId(display_id);
+ return Shell::Get()->display_manager()->IsActiveDisplayId(display_id);
}
display::Display WmShellAura::GetFirstDisplay() const {
- return Shell::GetInstance()
- ->display_manager()
- ->software_mirroring_display_list()[0];
+ return Shell::Get()->display_manager()->software_mirroring_display_list()[0];
}
bool WmShellAura::IsInUnifiedMode() const {
- return Shell::GetInstance()->display_manager()->IsInUnifiedMode();
+ return Shell::Get()->display_manager()->IsInUnifiedMode();
}
bool WmShellAura::IsInUnifiedModeIgnoreMirroring() const {
- return Shell::GetInstance()
+ return Shell::Get()
->display_manager()
->current_default_multi_display_mode() ==
display::DisplayManager::UNIFIED;
@@ -116,26 +114,26 @@
void WmShellAura::SetDisplayWorkAreaInsets(WmWindow* window,
const gfx::Insets& insets) {
- Shell::GetInstance()
+ Shell::Get()
->window_tree_host_manager()
->UpdateWorkAreaOfDisplayNearestWindow(window->aura_window(), insets);
}
void WmShellAura::LockCursor() {
- Shell::GetInstance()->cursor_manager()->LockCursor();
+ Shell::Get()->cursor_manager()->LockCursor();
}
void WmShellAura::UnlockCursor() {
- Shell::GetInstance()->cursor_manager()->UnlockCursor();
+ Shell::Get()->cursor_manager()->UnlockCursor();
}
bool WmShellAura::IsMouseEventsEnabled() {
- return Shell::GetInstance()->cursor_manager()->IsMouseEventsEnabled();
+ return Shell::Get()->cursor_manager()->IsMouseEventsEnabled();
}
std::vector<WmWindow*> WmShellAura::GetAllRootWindows() {
aura::Window::Windows root_windows =
- Shell::GetInstance()->window_tree_host_manager()->GetAllRootWindows();
+ Shell::Get()->window_tree_host_manager()->GetAllRootWindows();
std::vector<WmWindow*> wm_windows(root_windows.size());
for (size_t i = 0; i < root_windows.size(); ++i)
wm_windows[i] = WmWindow::Get(root_windows[i]);
@@ -143,7 +141,7 @@
}
void WmShellAura::RecordUserMetricsAction(UserMetricsAction action) {
- Shell::GetInstance()->metrics()->RecordUserMetricsAction(action);
+ Shell::Get()->metrics()->RecordUserMetricsAction(action);
}
void WmShellAura::RecordGestureAction(GestureActionType action) {
@@ -151,8 +149,7 @@
}
void WmShellAura::RecordTaskSwitchMetric(TaskSwitchSource source) {
- Shell::GetInstance()->metrics()->task_switch_metrics_recorder().OnTaskSwitch(
- source);
+ Shell::Get()->metrics()->task_switch_metrics_recorder().OnTaskSwitch(source);
}
std::unique_ptr<WindowResizer> WmShellAura::CreateDragWindowResizer(
@@ -201,13 +198,13 @@
}
SessionStateDelegate* WmShellAura::GetSessionStateDelegate() {
- return Shell::GetInstance()->session_state_delegate();
+ return Shell::Get()->session_state_delegate();
}
void WmShellAura::AddDisplayObserver(WmDisplayObserver* observer) {
if (!added_display_observer_) {
added_display_observer_ = true;
- Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ Shell::Get()->window_tree_host_manager()->AddObserver(this);
}
display_observers_.AddObserver(observer);
}
@@ -230,17 +227,15 @@
}
void WmShellAura::ToggleIgnoreExternalKeyboard() {
- Shell::GetInstance()
- ->virtual_keyboard_controller()
- ->ToggleIgnoreExternalKeyboard();
+ Shell::Get()->virtual_keyboard_controller()->ToggleIgnoreExternalKeyboard();
}
void WmShellAura::SetLaserPointerEnabled(bool enabled) {
- Shell::GetInstance()->laser_pointer_controller()->SetEnabled(enabled);
+ Shell::Get()->laser_pointer_controller()->SetEnabled(enabled);
}
void WmShellAura::SetPartialMagnifierEnabled(bool enabled) {
- Shell::GetInstance()->partial_magnification_controller()->SetEnabled(enabled);
+ Shell::Get()->partial_magnification_controller()->SetEnabled(enabled);
}
void WmShellAura::CreatePointerWatcherAdapter() {
@@ -248,14 +243,13 @@
}
void WmShellAura::CreatePrimaryHost() {
- Shell::GetInstance()->window_tree_host_manager()->Start();
+ Shell::Get()->window_tree_host_manager()->Start();
AshWindowTreeHostInitParams ash_init_params;
- Shell::GetInstance()->window_tree_host_manager()->CreatePrimaryHost(
- ash_init_params);
+ Shell::Get()->window_tree_host_manager()->CreatePrimaryHost(ash_init_params);
}
void WmShellAura::InitHosts(const ShellInitParams& init_params) {
- Shell::GetInstance()->window_tree_host_manager()->InitHosts();
+ Shell::Get()->window_tree_host_manager()->InitHosts();
}
std::unique_ptr<AcceleratorController>
diff --git a/ash/autoclick/autoclick_controller.cc b/ash/autoclick/autoclick_controller.cc
index 55a70b3..174a7bd1 100644
--- a/ash/autoclick/autoclick_controller.cc
+++ b/ash/autoclick/autoclick_controller.cc
@@ -101,10 +101,10 @@
enabled_ = enabled;
if (enabled_) {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
autoclick_controller_common_->CancelAutoclick();
} else {
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
}
diff --git a/ash/autoclick/autoclick_unittest.cc b/ash/autoclick/autoclick_unittest.cc
index 73d21ff..446a67d 100644
--- a/ash/autoclick/autoclick_unittest.cc
+++ b/ash/autoclick/autoclick_unittest.cc
@@ -63,7 +63,7 @@
void SetUp() override {
test::AshTestBase::SetUp();
- Shell::GetInstance()->AddPreTargetHandler(&mouse_event_capturer_);
+ Shell::Get()->AddPreTargetHandler(&mouse_event_capturer_);
GetAutoclickController()->SetAutoclickDelay(base::TimeDelta());
// Move mouse to deterministic location at the start of each test.
@@ -72,12 +72,12 @@
// Make sure the display is initialized so we don't fail the test due to any
// input events caused from creating the display.
if (!WmShell::Get()->IsRunningInMash())
- Shell::GetInstance()->display_manager()->UpdateDisplays();
+ Shell::Get()->display_manager()->UpdateDisplays();
RunAllPendingInMessageLoop();
}
void TearDown() override {
- Shell::GetInstance()->RemovePreTargetHandler(&mouse_event_capturer_);
+ Shell::Get()->RemovePreTargetHandler(&mouse_event_capturer_);
test::AshTestBase::TearDown();
}
@@ -94,7 +94,7 @@
}
AutoclickController* GetAutoclickController() {
- return Shell::GetInstance()->autoclick_controller();
+ return Shell::Get()->autoclick_controller();
}
private:
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index a95f9f6..7fecc54 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -380,9 +380,7 @@
// When spoken feedback is enabled, we should neither toggle the list nor
// consume the key since Search+Shift is one of the shortcuts the a11y
// feature uses. crbug.com/132296
- if (Shell::GetInstance()
- ->accessibility_delegate()
- ->IsSpokenFeedbackEnabled())
+ if (Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled())
return false;
}
return true;
@@ -521,8 +519,8 @@
}
bool CanHandleShowStylusTools() {
- return Shell::GetInstance()->palette_delegate() &&
- Shell::GetInstance()->palette_delegate()->ShouldShowPalette();
+ return Shell::Get()->palette_delegate() &&
+ Shell::Get()->palette_delegate()->ShouldShowPalette();
}
void HandleSuspend() {
@@ -612,13 +610,13 @@
message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
- Shell::GetInstance()->accessibility_delegate()->ToggleHighContrast();
+ Shell::Get()->accessibility_delegate()->ToggleHighContrast();
}
void HandleToggleSpokenFeedback() {
base::RecordAction(UserMetricsAction("Accel_Toggle_Spoken_Feedback"));
- Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback(
+ Shell::Get()->accessibility_delegate()->ToggleSpokenFeedback(
A11Y_NOTIFICATION_SHOW);
}
@@ -1258,7 +1256,7 @@
}
if (Shell::Get()->mru_window_tracker()->BuildMruWindowList().empty() &&
actions_needing_window_.find(action) != actions_needing_window_.end()) {
- Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert(
+ Shell::Get()->accessibility_delegate()->TriggerAccessibilityAlert(
A11Y_ALERT_WINDOW_NEEDED);
return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
}
diff --git a/ash/common/accelerators/debug_commands.cc b/ash/common/accelerators/debug_commands.cc
index b4269f2..fbbffef 100644
--- a/ash/common/accelerators/debug_commands.cc
+++ b/ash/common/accelerators/debug_commands.cc
@@ -109,7 +109,7 @@
void HandleToggleWallpaperMode() {
static int index = 0;
WallpaperController* wallpaper_controller =
- Shell::GetInstance()->wallpaper_controller();
+ Shell::Get()->wallpaper_controller();
switch (++index % 4) {
case 0:
Shell::Get()->wallpaper_delegate()->InitializeWallpaper();
@@ -192,7 +192,7 @@
HandlePrintWindowHierarchy();
break;
case DEBUG_SHOW_TOAST:
- Shell::GetInstance()->toast_manager()->Show(
+ Shell::Get()->toast_manager()->Show(
ToastData("id", base::ASCIIToUTF16("Toast"), 5000 /* duration_ms */,
base::ASCIIToUTF16("Dismiss")));
break;
diff --git a/ash/common/frame/header_view.cc b/ash/common/frame/header_view.cc
index 462c670c..c55a9ed 100644
--- a/ash/common/frame/header_view.cc
+++ b/ash/common/frame/header_view.cc
@@ -31,11 +31,11 @@
header_painter_->Init(target_widget_, this, caption_button_container_);
UpdateAvatarIcon();
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
HeaderView::~HeaderView() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void HeaderView::SchedulePaintForTitle() {
diff --git a/ash/common/keyboard/keyboard_ui.cc b/ash/common/keyboard/keyboard_ui.cc
index f7be5dc..1b996396 100644
--- a/ash/common/keyboard/keyboard_ui.cc
+++ b/ash/common/keyboard/keyboard_ui.cc
@@ -39,9 +39,7 @@
// to the appropriate keyboard functions.
}
bool IsEnabled() override {
- return Shell::GetInstance()
- ->accessibility_delegate()
- ->IsVirtualKeyboardEnabled();
+ return Shell::Get()->accessibility_delegate()->IsVirtualKeyboardEnabled();
}
// AccessibilityObserver:
diff --git a/ash/common/mojo_interface_factory.cc b/ash/common/mojo_interface_factory.cc
index e18be58..b7ec654 100644
--- a/ash/common/mojo_interface_factory.cc
+++ b/ash/common/mojo_interface_factory.cc
@@ -85,7 +85,7 @@
void BindWallpaperRequestOnMainThread(
mojom::WallpaperControllerRequest request) {
- Shell::GetInstance()->wallpaper_controller()->BindRequest(std::move(request));
+ Shell::Get()->wallpaper_controller()->BindRequest(std::move(request));
}
} // namespace
diff --git a/ash/common/scoped_root_window_for_new_windows.cc b/ash/common/scoped_root_window_for_new_windows.cc
index 55c59d2..df7bd41 100644
--- a/ash/common/scoped_root_window_for_new_windows.cc
+++ b/ash/common/scoped_root_window_for_new_windows.cc
@@ -12,11 +12,11 @@
ScopedRootWindowForNewWindows::ScopedRootWindowForNewWindows(
WmWindow* new_root) {
DCHECK(new_root);
- Shell::GetInstance()->scoped_root_window_for_new_windows_ = new_root;
+ Shell::Get()->scoped_root_window_for_new_windows_ = new_root;
}
ScopedRootWindowForNewWindows::~ScopedRootWindowForNewWindows() {
- Shell::GetInstance()->scoped_root_window_for_new_windows_ = nullptr;
+ Shell::Get()->scoped_root_window_for_new_windows_ = nullptr;
}
} // namespace ash
diff --git a/ash/common/shelf/shelf_layout_manager.cc b/ash/common/shelf/shelf_layout_manager.cc
index 426a9b9..20112a8 100644
--- a/ash/common/shelf/shelf_layout_manager.cc
+++ b/ash/common/shelf/shelf_layout_manager.cc
@@ -159,9 +159,9 @@
keyboard_observer_(this) {
DCHECK(shelf_widget_);
DCHECK(wm_shelf_);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
WmShell::Get()->AddLockStateObserver(this);
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
Shell::Get()->session_controller()->AddSessionStateObserver(this);
state_.session_state = Shell::Get()->session_controller()->GetSessionState();
}
@@ -172,7 +172,7 @@
for (auto& observer : observers_)
observer.WillDeleteShelfLayoutManager();
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
WmShell::Get()->RemoveLockStateObserver(this);
Shell::Get()->session_controller()->RemoveSessionStateObserver(this);
}
@@ -180,7 +180,7 @@
void ShelfLayoutManager::PrepareForShutdown() {
in_shutdown_ = true;
// Stop observing changes to avoid updating a partially destructed shelf.
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
}
bool ShelfLayoutManager::IsVisible() const {
diff --git a/ash/common/shelf/shelf_locking_manager.cc b/ash/common/shelf/shelf_locking_manager.cc
index 84bfcbfa..a63bf59 100644
--- a/ash/common/shelf/shelf_locking_manager.cc
+++ b/ash/common/shelf/shelf_locking_manager.cc
@@ -20,13 +20,13 @@
controller->GetSessionState() != session_manager::SessionState::ACTIVE;
screen_locked_ = controller->IsScreenLocked();
controller->AddSessionStateObserver(this);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
ShelfLockingManager::~ShelfLockingManager() {
WmShell::Get()->RemoveLockStateObserver(this);
Shell::Get()->session_controller()->RemoveSessionStateObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void ShelfLockingManager::OnLockStateChanged(bool locked) {
diff --git a/ash/common/shelf/shelf_widget.cc b/ash/common/shelf/shelf_widget.cc
index b18416c6..b41ab3e 100644
--- a/ash/common/shelf/shelf_widget.cc
+++ b/ash/common/shelf/shelf_widget.cc
@@ -135,7 +135,7 @@
shelf_view_(nullptr),
background_animator_(SHELF_BACKGROUND_DEFAULT,
wm_shelf_,
- Shell::GetInstance()->wallpaper_controller()),
+ Shell::Get()->wallpaper_controller()),
activating_as_fallback_(false) {
DCHECK(wm_shelf_);
background_animator_.AddObserver(this);
diff --git a/ash/common/shelf/shelf_window_watcher.cc b/ash/common/shelf/shelf_window_watcher.cc
index 090f296..8178432 100644
--- a/ash/common/shelf/shelf_window_watcher.cc
+++ b/ash/common/shelf/shelf_window_watcher.cc
@@ -145,7 +145,7 @@
user_window_observer_(this),
observed_container_windows_(&container_window_observer_),
observed_user_windows_(&user_window_observer_) {
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
for (const auto& display : display::Screen::GetScreen()->GetAllDisplays())
OnDisplayAdded(display);
display::Screen::GetScreen()->AddObserver(this);
@@ -153,7 +153,7 @@
ShelfWindowWatcher::~ShelfWindowWatcher() {
display::Screen::GetScreen()->RemoveObserver(this);
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
}
void ShelfWindowWatcher::AddShelfItem(aura::Window* window) {
diff --git a/ash/common/shelf/wm_shelf.cc b/ash/common/shelf/wm_shelf.cc
index 74247105..20735dd 100644
--- a/ash/common/shelf/wm_shelf.cc
+++ b/ash/common/shelf/wm_shelf.cc
@@ -42,10 +42,10 @@
public:
explicit AutoHideEventHandler(ShelfLayoutManager* shelf_layout_manager)
: shelf_layout_manager_(shelf_layout_manager) {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
}
~AutoHideEventHandler() override {
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
// Overridden from ui::EventHandler:
@@ -175,8 +175,7 @@
shelf_widget_->OnShelfAlignmentChanged();
shelf_layout_manager_->LayoutShelf();
Shell::Get()->shelf_controller()->NotifyShelfAlignmentChanged(this);
- Shell::GetInstance()->NotifyShelfAlignmentChanged(
- GetWindow()->GetRootWindow());
+ Shell::Get()->NotifyShelfAlignmentChanged(GetWindow()->GetRootWindow());
}
bool WmShelf::IsHorizontalAlignment() const {
@@ -220,7 +219,7 @@
auto_hide_behavior_ = auto_hide_behavior;
Shell::Get()->shelf_controller()->NotifyShelfAutoHideBehaviorChanged(this);
- Shell::GetInstance()->NotifyShelfAutoHideBehaviorChanged(
+ Shell::Get()->NotifyShelfAutoHideBehaviorChanged(
GetWindow()->GetRootWindow());
}
diff --git a/ash/common/system/chromeos/brightness/tray_brightness.cc b/ash/common/system/chromeos/brightness/tray_brightness.cc
index b5262021..f9f8033 100644
--- a/ash/common/system/chromeos/brightness/tray_brightness.cc
+++ b/ash/common/system/chromeos/brightness/tray_brightness.cc
@@ -113,7 +113,7 @@
tri_view->AddView(TriView::Container::CENTER, slider_);
if (is_default_view_) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
SetVisible(Shell::Get()
->maximize_mode_controller()
->IsMaximizeModeWindowManagerEnabled());
@@ -124,7 +124,7 @@
BrightnessView::~BrightnessView() {
if (is_default_view_)
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void BrightnessView::SetBrightnessPercent(double percent) {
diff --git a/ash/common/system/chromeos/cast/tray_cast.cc b/ash/common/system/chromeos/cast/tray_cast.cc
index efab106..2e08c675 100644
--- a/ash/common/system/chromeos/cast/tray_cast.cc
+++ b/ash/common/system/chromeos/cast/tray_cast.cc
@@ -422,14 +422,14 @@
TrayCast::TrayCast(SystemTray* system_tray)
: SystemTrayItem(system_tray, UMA_CAST) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
Shell::Get()->cast_config()->AddObserver(this);
Shell::Get()->cast_config()->RequestDeviceRefresh();
}
TrayCast::~TrayCast() {
Shell::Get()->cast_config()->RemoveObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void TrayCast::StartCastForTest(const std::string& receiver_id) {
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
index 72f81e6..be1e7cf 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
@@ -377,7 +377,7 @@
}
AccessibilityDelegate* accessibility_delegate =
- Shell::GetInstance()->accessibility_delegate();
+ Shell::Get()->accessibility_delegate();
// Fails to show the keyboard.
if (accessibility_delegate->IsVirtualKeyboardEnabled())
return;
@@ -410,9 +410,8 @@
}
bool ImeMenuTray::ShouldShowKeyboardToggle() const {
- return keyboard_suppressed_ && !Shell::GetInstance()
- ->accessibility_delegate()
- ->IsVirtualKeyboardEnabled();
+ return keyboard_suppressed_ &&
+ !Shell::Get()->accessibility_delegate()->IsVirtualKeyboardEnabled();
}
base::string16 ImeMenuTray::GetAccessibleNameForTray() {
@@ -528,8 +527,7 @@
if (!force_show_keyboard_)
return;
- Shell::GetInstance()->accessibility_delegate()->SetVirtualKeyboardEnabled(
- false);
+ Shell::Get()->accessibility_delegate()->SetVirtualKeyboardEnabled(false);
force_show_keyboard_ = false;
}
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc b/ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc
index 1b8273e8..dbbc5201 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc
@@ -259,7 +259,7 @@
EXPECT_TRUE(IsBubbleShown());
AccessibilityDelegate* accessibility_delegate =
- Shell::GetInstance()->accessibility_delegate();
+ Shell::Get()->accessibility_delegate();
accessibility_delegate->SetVirtualKeyboardEnabled(true);
EXPECT_TRUE(accessibility_delegate->IsVirtualKeyboardEnabled());
@@ -278,7 +278,7 @@
TEST_F(ImeMenuTrayTest, ForceToShowEmojiKeyset) {
AccessibilityDelegate* accessibility_delegate =
- Shell::GetInstance()->accessibility_delegate();
+ Shell::Get()->accessibility_delegate();
accessibility_delegate->SetVirtualKeyboardEnabled(false);
ASSERT_FALSE(accessibility_delegate->IsVirtualKeyboardEnabled());
diff --git a/ash/common/system/chromeos/network/sms_observer_unittest.cc b/ash/common/system/chromeos/network/sms_observer_unittest.cc
index 4aea419..f9c05a6c 100644
--- a/ash/common/system/chromeos/network/sms_observer_unittest.cc
+++ b/ash/common/system/chromeos/network/sms_observer_unittest.cc
@@ -45,9 +45,7 @@
SmsObserverTest() {}
~SmsObserverTest() override {}
- SmsObserver* GetSmsObserver() {
- return Shell::GetInstance()->sms_observer_.get();
- }
+ SmsObserver* GetSmsObserver() { return Shell::Get()->sms_observer_.get(); }
private:
DISALLOW_COPY_AND_ASSIGN(SmsObserverTest);
diff --git a/ash/common/system/chromeos/palette/palette_tray.cc b/ash/common/system/chromeos/palette/palette_tray.cc
index 197e75a..a5ab72d 100644
--- a/ash/common/system/chromeos/palette/palette_tray.cc
+++ b/ash/common/system/chromeos/palette/palette_tray.cc
@@ -164,7 +164,7 @@
tray_container()->SetMargin(kTrayIconMainAxisInset, kTrayIconCrossAxisInset);
tray_container()->AddChildView(icon_);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
Shell::Get()->session_controller()->AddSessionStateObserver(this);
ui::InputDeviceManager::GetInstance()->AddObserver(this);
}
@@ -174,7 +174,7 @@
bubble_->bubble_view()->reset_delegate();
ui::InputDeviceManager::GetInstance()->RemoveObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
Shell::Get()->session_controller()->RemoveSessionStateObserver(this);
}
@@ -287,7 +287,7 @@
if (!palette_utils::HasStylusInput())
return;
- PaletteDelegate* palette_delegate = Shell::GetInstance()->palette_delegate();
+ PaletteDelegate* palette_delegate = Shell::Get()->palette_delegate();
// Don't do anything if the palette should not be shown or if the user has
// disabled it all-together.
@@ -399,7 +399,7 @@
}
void PaletteTray::Initialize() {
- PaletteDelegate* delegate = Shell::GetInstance()->palette_delegate();
+ PaletteDelegate* delegate = Shell::Get()->palette_delegate();
// |delegate| can be null in tests.
if (!delegate)
return;
diff --git a/ash/common/system/chromeos/palette/tools/capture_region_mode.cc b/ash/common/system/chromeos/palette/tools/capture_region_mode.cc
index dd0c016..afa2683 100644
--- a/ash/common/system/chromeos/palette/tools/capture_region_mode.cc
+++ b/ash/common/system/chromeos/palette/tools/capture_region_mode.cc
@@ -46,9 +46,9 @@
ToastData toast(kToastId, l10n_util::GetStringUTF16(
IDS_ASH_STYLUS_TOOLS_CAPTURE_REGION_TOAST),
kToastDurationMs, base::Optional<base::string16>());
- Shell::GetInstance()->toast_manager()->Show(toast);
+ Shell::Get()->toast_manager()->Show(toast);
- Shell::GetInstance()->palette_delegate()->TakePartialScreenshot(base::Bind(
+ Shell::Get()->palette_delegate()->TakePartialScreenshot(base::Bind(
&CaptureRegionMode::OnScreenshotDone, weak_factory_.GetWeakPtr()));
delegate()->HidePalette();
}
@@ -58,7 +58,7 @@
// If the user manually cancelled the action we need to make sure to cancel
// the screenshot session as well.
- Shell::GetInstance()->palette_delegate()->CancelPartialScreenshot();
+ Shell::Get()->palette_delegate()->CancelPartialScreenshot();
}
views::View* CaptureRegionMode::CreateView() {
diff --git a/ash/common/system/chromeos/palette/tools/capture_screen_action.cc b/ash/common/system/chromeos/palette/tools/capture_screen_action.cc
index 29cfd10..2c300a25 100644
--- a/ash/common/system/chromeos/palette/tools/capture_screen_action.cc
+++ b/ash/common/system/chromeos/palette/tools/capture_screen_action.cc
@@ -31,7 +31,7 @@
delegate()->DisableTool(GetToolId());
delegate()->HidePaletteImmediately();
- Shell::GetInstance()->palette_delegate()->TakeScreenshot();
+ Shell::Get()->palette_delegate()->TakeScreenshot();
}
views::View* CaptureScreenAction::CreateView() {
diff --git a/ash/common/system/chromeos/palette/tools/create_note_action.cc b/ash/common/system/chromeos/palette/tools/create_note_action.cc
index bbdc251..b01cf0f 100644
--- a/ash/common/system/chromeos/palette/tools/create_note_action.cc
+++ b/ash/common/system/chromeos/palette/tools/create_note_action.cc
@@ -29,14 +29,14 @@
void CreateNoteAction::OnEnable() {
CommonPaletteTool::OnEnable();
- Shell::GetInstance()->palette_delegate()->CreateNote();
+ Shell::Get()->palette_delegate()->CreateNote();
delegate()->DisableTool(GetToolId());
delegate()->HidePalette();
}
views::View* CreateNoteAction::CreateView() {
- if (!Shell::GetInstance()->palette_delegate()->HasNoteApp())
+ if (!Shell::Get()->palette_delegate()->HasNoteApp())
return nullptr;
return CreateDefaultView(
diff --git a/ash/common/system/chromeos/palette/tools/create_note_unittest.cc b/ash/common/system/chromeos/palette/tools/create_note_unittest.cc
index d8af84c..c2ba8fe6 100644
--- a/ash/common/system/chromeos/palette/tools/create_note_unittest.cc
+++ b/ash/common/system/chromeos/palette/tools/create_note_unittest.cc
@@ -35,8 +35,7 @@
}
TestPaletteDelegate* test_palette_delegate() {
- return static_cast<TestPaletteDelegate*>(
- Shell::GetInstance()->palette_delegate());
+ return static_cast<TestPaletteDelegate*>(Shell::Get()->palette_delegate());
}
protected:
diff --git a/ash/common/system/chromeos/palette/tools/screenshot_unittest.cc b/ash/common/system/chromeos/palette/tools/screenshot_unittest.cc
index f66426d1..29cfe26 100644
--- a/ash/common/system/chromeos/palette/tools/screenshot_unittest.cc
+++ b/ash/common/system/chromeos/palette/tools/screenshot_unittest.cc
@@ -34,8 +34,7 @@
}
TestPaletteDelegate* test_palette_delegate() {
- return static_cast<TestPaletteDelegate*>(
- Shell::GetInstance()->palette_delegate());
+ return static_cast<TestPaletteDelegate*>(Shell::Get()->palette_delegate());
}
protected:
diff --git a/ash/common/system/chromeos/screen_security/screen_capture_tray_item.cc b/ash/common/system/chromeos/screen_security/screen_capture_tray_item.cc
index 3920c4ed..ecf05f1 100644
--- a/ash/common/system/chromeos/screen_security/screen_capture_tray_item.cc
+++ b/ash/common/system/chromeos/screen_security/screen_capture_tray_item.cc
@@ -29,12 +29,12 @@
ScreenCaptureTrayItem::ScreenCaptureTrayItem(SystemTray* system_tray)
: ScreenTrayItem(system_tray, UMA_SCREEN_CAPTURE) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
Shell::Get()->system_tray_notifier()->AddScreenCaptureObserver(this);
}
ScreenCaptureTrayItem::~ScreenCaptureTrayItem() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
Shell::Get()->system_tray_notifier()->RemoveScreenCaptureObserver(this);
}
diff --git a/ash/common/system/chromeos/session/logout_confirmation_controller.cc b/ash/common/system/chromeos/session/logout_confirmation_controller.cc
index e93d6ac..01933d75 100644
--- a/ash/common/system/chromeos/session/logout_confirmation_controller.cc
+++ b/ash/common/system/chromeos/session/logout_confirmation_controller.cc
@@ -28,14 +28,14 @@
dialog_(NULL),
logout_timer_(false, false) {
if (Shell::HasInstance()) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
Shell::Get()->system_tray_notifier()->AddLastWindowClosedObserver(this);
}
}
LogoutConfirmationController::~LogoutConfirmationController() {
if (Shell::HasInstance()) {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
Shell::Get()->system_tray_notifier()->RemoveLastWindowClosedObserver(this);
}
if (dialog_)
diff --git a/ash/common/system/chromeos/tray_caps_lock.cc b/ash/common/system/chromeos/tray_caps_lock.cc
index d7432cda..132c3b67 100644
--- a/ash/common/system/chromeos/tray_caps_lock.cc
+++ b/ash/common/system/chromeos/tray_caps_lock.cc
@@ -159,7 +159,7 @@
caps_lock_enabled_ = enabled;
// Send an a11y alert.
- Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert(
+ Shell::Get()->accessibility_delegate()->TriggerAccessibilityAlert(
enabled ? A11Y_ALERT_CAPS_ON : A11Y_ALERT_CAPS_OFF);
if (tray_view())
diff --git a/ash/common/system/ime/tray_ime_chromeos.cc b/ash/common/system/ime/tray_ime_chromeos.cc
index 501bd53..e395bd2 100644
--- a/ash/common/system/ime/tray_ime_chromeos.cc
+++ b/ash/common/system/ime/tray_ime_chromeos.cc
@@ -206,9 +206,8 @@
}
bool TrayIME::ShouldShowKeyboardToggle() {
- return keyboard_suppressed_ && !Shell::GetInstance()
- ->accessibility_delegate()
- ->IsVirtualKeyboardEnabled();
+ return keyboard_suppressed_ &&
+ !Shell::Get()->accessibility_delegate()->IsVirtualKeyboardEnabled();
}
base::string16 TrayIME::GetDefaultViewLabel(bool show_ime_label) {
diff --git a/ash/common/system/ime/tray_ime_chromeos_unittest.cc b/ash/common/system/ime/tray_ime_chromeos_unittest.cc
index 8530e4f..8221b50 100644
--- a/ash/common/system/ime/tray_ime_chromeos_unittest.cc
+++ b/ash/common/system/ime/tray_ime_chromeos_unittest.cc
@@ -60,8 +60,7 @@
};
void TrayIMETest::SetAccessibilityKeyboardEnabled(bool enabled) {
- Shell::GetInstance()->accessibility_delegate()->SetVirtualKeyboardEnabled(
- enabled);
+ Shell::Get()->accessibility_delegate()->SetVirtualKeyboardEnabled(enabled);
keyboard::SetAccessibilityKeyboardEnabled(enabled);
AccessibilityNotificationVisibility notification =
enabled ? A11Y_NOTIFICATION_SHOW : A11Y_NOTIFICATION_NONE;
diff --git a/ash/common/system/overview/overview_button_tray.cc b/ash/common/system/overview/overview_button_tray.cc
index 8eaeaf8a..8f85033 100644
--- a/ash/common/system/overview/overview_button_tray.cc
+++ b/ash/common/system/overview/overview_button_tray.cc
@@ -33,12 +33,12 @@
// horizontal shelf, no separator is required.
set_separator_visibility(false);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
Shell::Get()->session_controller()->AddSessionStateObserver(this);
}
OverviewButtonTray::~OverviewButtonTray() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
Shell::Get()->session_controller()->RemoveSessionStateObserver(this);
}
diff --git a/ash/common/system/tiles/tiles_default_view.cc b/ash/common/system/tiles/tiles_default_view.cc
index 1e3ebed..07b7101 100644
--- a/ash/common/system/tiles/tiles_default_view.cc
+++ b/ash/common/system/tiles/tiles_default_view.cc
@@ -123,7 +123,7 @@
->RequestLockScreen();
} else if (sender == power_button_) {
shell->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN);
- Shell::GetInstance()->lock_state_controller()->RequestShutdown();
+ Shell::Get()->lock_state_controller()->RequestShutdown();
}
owner_->system_tray()->CloseSystemBubble();
diff --git a/ash/common/system/tray/system_tray.cc b/ash/common/system/tray/system_tray.cc
index ee60335..8f3f1945 100644
--- a/ash/common/system/tray/system_tray.cc
+++ b/ash/common/system/tray/system_tray.cc
@@ -134,9 +134,7 @@
// If ChromeVox is enabled, focus the default item if no item is focused and
// there isn't a delayed close.
- if (Shell::GetInstance()
- ->accessibility_delegate()
- ->IsSpokenFeedbackEnabled() &&
+ if (Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled() &&
!is_persistent) {
bubble_->FocusDefaultIfNeeded();
}
@@ -165,11 +163,11 @@
public:
explicit ActivationObserver(SystemTray* tray) : tray_(tray) {
DCHECK(tray_);
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
}
~ActivationObserver() override {
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
}
// WmActivationObserver:
@@ -474,9 +472,7 @@
if (system_bubble_.get() && creation_type == BUBBLE_USE_EXISTING) {
system_bubble_->bubble()->UpdateView(items, bubble_type);
// If ChromeVox is enabled, focus the default item if no item is focused.
- if (Shell::GetInstance()
- ->accessibility_delegate()
- ->IsSpokenFeedbackEnabled())
+ if (Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled())
system_bubble_->bubble()->FocusDefaultIfNeeded();
} else {
// Cleanup the existing bubble before showing a new one. Otherwise, it's
diff --git a/ash/common/system/tray/system_tray_unittest.cc b/ash/common/system/tray/system_tray_unittest.cc
index 05dc12b..8f4f0206 100644
--- a/ash/common/system/tray/system_tray_unittest.cc
+++ b/ash/common/system/tray/system_tray_unittest.cc
@@ -518,8 +518,7 @@
TEST_F(SystemTrayTest, WithSystemModal) {
// Check if the accessibility item is created even with system modal dialog.
- Shell::GetInstance()->accessibility_delegate()->SetVirtualKeyboardEnabled(
- true);
+ Shell::Get()->accessibility_delegate()->SetVirtualKeyboardEnabled(true);
std::unique_ptr<views::Widget> widget(CreateTestWidget(
new ModalWidgetDelegate, kShellWindowId_SystemModalContainer,
gfx::Rect(0, 0, 100, 100)));
diff --git a/ash/common/system/tray_accessibility.cc b/ash/common/system/tray_accessibility.cc
index 47eb8fb..3d32c7a 100644
--- a/ash/common/system/tray_accessibility.cc
+++ b/ash/common/system/tray_accessibility.cc
@@ -57,8 +57,7 @@
};
uint32_t GetAccessibilityState() {
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
uint32_t state = A11Y_NONE;
if (delegate->IsSpokenFeedbackEnabled())
state |= A11Y_SPOKEN_FEEDBACK;
@@ -226,8 +225,7 @@
void AccessibilityDetailedView::AppendAccessibilityList() {
CreateScrollableList();
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
spoken_feedback_enabled_ = delegate->IsSpokenFeedbackEnabled();
spoken_feedback_view_ = AddScrollListItem(
l10n_util::GetStringUTF16(
@@ -334,8 +332,7 @@
}
void AccessibilityDetailedView::HandleViewClicked(views::View* view) {
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
UserMetricsAction user_action;
if (view == spoken_feedback_view_) {
user_action = delegate->IsSpokenFeedbackEnabled()
@@ -479,8 +476,7 @@
// - "Enable accessibility menu" on chrome://settings is checked;
// - or any of accessibility features is enabled
// Otherwise, not shows it.
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
if (login_ != LoginStatus::NOT_LOGGED_IN &&
!delegate->ShouldShowAccessibilityMenu() &&
// On login screen, keeps the initial visibility of the menu.
diff --git a/ash/common/system/web_notification/ash_popup_alignment_delegate.cc b/ash/common/system/web_notification/ash_popup_alignment_delegate.cc
index b32732b..c1a5c3ed 100644
--- a/ash/common/system/web_notification/ash_popup_alignment_delegate.cc
+++ b/ash/common/system/web_notification/ash_popup_alignment_delegate.cc
@@ -40,7 +40,7 @@
AshPopupAlignmentDelegate::~AshPopupAlignmentDelegate() {
if (screen_)
screen_->RemoveObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
shelf_->RemoveObserver(this);
}
@@ -50,7 +50,7 @@
screen_ = screen;
work_area_ = display.work_area();
screen->AddObserver(this);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
if (tray_bubble_height_ > 0)
UpdateWorkArea();
}
diff --git a/ash/common/test/test_shelf_delegate.cc b/ash/common/test/test_shelf_delegate.cc
index 65565d1..51104ed 100644
--- a/ash/common/test/test_shelf_delegate.cc
+++ b/ash/common/test/test_shelf_delegate.cc
@@ -42,10 +42,8 @@
// shelf is created, to simulate ChromeLauncherController's behavior.
class ShelfInitializer : public ShellObserver {
public:
- ShelfInitializer() { Shell::GetInstance()->AddShellObserver(this); }
- ~ShelfInitializer() override {
- Shell::GetInstance()->RemoveShellObserver(this);
- }
+ ShelfInitializer() { Shell::Get()->AddShellObserver(this); }
+ ~ShelfInitializer() override { Shell::Get()->RemoveShellObserver(this); }
// ShellObserver:
void OnShelfCreatedForRootWindow(WmWindow* root_window) override {
diff --git a/ash/common/wallpaper/wallpaper_controller.cc b/ash/common/wallpaper/wallpaper_controller.cc
index db86f201..09864d6 100644
--- a/ash/common/wallpaper/wallpaper_controller.cc
+++ b/ash/common/wallpaper/wallpaper_controller.cc
@@ -94,7 +94,7 @@
wallpaper_reload_delay_(kWallpaperReloadDelayMs),
task_runner_(task_runner) {
WmShell::Get()->AddDisplayObserver(this);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
Shell::Get()->session_controller()->AddSessionStateObserver(this);
}
@@ -104,7 +104,7 @@
if (color_calculator_)
color_calculator_->RemoveObserver(this);
WmShell::Get()->RemoveDisplayObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
Shell::Get()->session_controller()->RemoveSessionStateObserver(this);
}
diff --git a/ash/common/wallpaper/wallpaper_controller_unittest.cc b/ash/common/wallpaper/wallpaper_controller_unittest.cc
index 4cb2fba..13503743 100644
--- a/ash/common/wallpaper/wallpaper_controller_unittest.cc
+++ b/ash/common/wallpaper/wallpaper_controller_unittest.cc
@@ -122,7 +122,7 @@
WmShell::Get()->GetPrimaryRootWindow()->GetRootWindowController();
root_window_controller->SetWallpaperWidgetController(nullptr);
root_window_controller->SetAnimatingWallpaperWidgetController(nullptr);
- controller_ = Shell::GetInstance()->wallpaper_controller();
+ controller_ = Shell::Get()->wallpaper_controller();
wallpaper_delegate_ = static_cast<test::TestWallpaperDelegate*>(
Shell::Get()->wallpaper_delegate());
controller_->set_wallpaper_reload_delay_for_test(0);
@@ -231,8 +231,7 @@
};
TEST_F(WallpaperControllerTest, BasicReparenting) {
- WallpaperController* controller =
- Shell::GetInstance()->wallpaper_controller();
+ WallpaperController* controller = Shell::Get()->wallpaper_controller();
controller->CreateEmptyWallpaper();
// Wallpaper view/window exists in the wallpaper container and nothing is in
@@ -264,8 +263,7 @@
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
// Create the wallpaper and its view.
- WallpaperController* controller =
- Shell::GetInstance()->wallpaper_controller();
+ WallpaperController* controller = Shell::Get()->wallpaper_controller();
controller->CreateEmptyWallpaper();
// The new wallpaper is ready to animate.
@@ -290,8 +288,7 @@
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
// Reset wallpaper state, see ControllerOwnership above.
- WallpaperController* controller =
- Shell::GetInstance()->wallpaper_controller();
+ WallpaperController* controller = Shell::Get()->wallpaper_controller();
controller->CreateEmptyWallpaper();
// Run wallpaper show animation to completion.
@@ -338,8 +335,7 @@
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
// Reset wallpaper state, see ControllerOwnership above.
- WallpaperController* controller =
- Shell::GetInstance()->wallpaper_controller();
+ WallpaperController* controller = Shell::Get()->wallpaper_controller();
controller->CreateEmptyWallpaper();
// Run wallpaper show animation to completion.
@@ -391,7 +387,7 @@
// that the resized image is the expected size.
controller_->SetWallpaperImage(image, WALLPAPER_LAYOUT_STRETCH);
EXPECT_TRUE(image.BackedBySameObjectAs(controller_->GetWallpaper()));
- RunAllBlockingPoolTasksUntilIdle(Shell::GetInstance()->blocking_pool().get());
+ RunAllBlockingPoolTasksUntilIdle(Shell::Get()->blocking_pool().get());
gfx::ImageSkia resized_image = controller_->GetWallpaper();
EXPECT_FALSE(image.BackedBySameObjectAs(resized_image));
EXPECT_EQ(gfx::Size(320, 200).ToString(), resized_image.size().ToString());
@@ -400,7 +396,7 @@
// previously-resized image instead of doing another resize
// (http://crbug.com/321402).
controller_->SetWallpaperImage(image, WALLPAPER_LAYOUT_STRETCH);
- RunAllBlockingPoolTasksUntilIdle(Shell::GetInstance()->blocking_pool().get());
+ RunAllBlockingPoolTasksUntilIdle(Shell::Get()->blocking_pool().get());
EXPECT_TRUE(resized_image.BackedBySameObjectAs(controller_->GetWallpaper()));
}
diff --git a/ash/common/wallpaper/wallpaper_view.cc b/ash/common/wallpaper/wallpaper_view.cc
index 8fedb4a..325f59e 100644
--- a/ash/common/wallpaper/wallpaper_view.cc
+++ b/ash/common/wallpaper/wallpaper_view.cc
@@ -126,8 +126,7 @@
// to fill the wallpaper. Ideally the image should be larger than the largest
// display supported, if not we will scale and center it if the layout is
// wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED.
- WallpaperController* controller =
- Shell::GetInstance()->wallpaper_controller();
+ WallpaperController* controller = Shell::Get()->wallpaper_controller();
gfx::ImageSkia wallpaper = controller->GetWallpaper();
wallpaper::WallpaperLayout layout = controller->GetWallpaperLayout();
@@ -193,8 +192,7 @@
}
views::Widget* CreateWallpaper(WmWindow* root_window, int container_id) {
- WallpaperController* controller =
- Shell::GetInstance()->wallpaper_controller();
+ WallpaperController* controller = Shell::Get()->wallpaper_controller();
WallpaperDelegate* wallpaper_delegate = Shell::Get()->wallpaper_delegate();
views::Widget* wallpaper_widget = new views::Widget;
diff --git a/ash/common/wm/lock_layout_manager.cc b/ash/common/wm/lock_layout_manager.cc
index 1b5c27e..568c4777 100644
--- a/ash/common/wm/lock_layout_manager.cc
+++ b/ash/common/wm/lock_layout_manager.cc
@@ -21,7 +21,7 @@
window_(window),
root_window_(window->GetRootWindow()),
keyboard_observer_(this) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
root_window_->aura_window()->AddObserver(this);
if (keyboard::KeyboardController::GetInstance())
keyboard_observer_.Add(keyboard::KeyboardController::GetInstance());
@@ -34,7 +34,7 @@
for (WmWindow* child : window_->GetChildren())
child->aura_window()->RemoveObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void LockLayoutManager::OnWindowResized() {
diff --git a/ash/common/wm/maximize_mode/maximize_mode_controller.cc b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
index 037ce1a..a08e7a2 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
@@ -111,7 +111,7 @@
tablet_mode_switch_is_on_(false),
lid_is_closed_(false),
weak_factory_(this) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
WmShell::Get()->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_INITIALLY_DISABLED);
// TODO(jonross): Do not create MaximizeModeController if the flag is
@@ -130,7 +130,7 @@
}
MaximizeModeController::~MaximizeModeController() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
if (IsEnabled()) {
WmShell::Get()->RemoveDisplayObserver(this);
@@ -162,17 +162,17 @@
// TODO(jonross): Move the maximize mode notifications from ShellObserver
// to MaximizeModeController::Observer
shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_ENABLED);
- Shell::GetInstance()->NotifyMaximizeModeStarted();
+ Shell::Get()->NotifyMaximizeModeStarted();
observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) {
observer->OnTouchViewToggled(true);
});
} else {
- Shell::GetInstance()->NotifyMaximizeModeEnding();
+ Shell::Get()->NotifyMaximizeModeEnding();
maximize_mode_window_manager_.reset();
shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_DISABLED);
- Shell::GetInstance()->NotifyMaximizeModeEnded();
+ Shell::Get()->NotifyMaximizeModeEnded();
observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) {
observer->OnTouchViewToggled(false);
diff --git a/ash/common/wm/maximize_mode/maximize_mode_window_manager.cc b/ash/common/wm/maximize_mode/maximize_mode_window_manager.cc
index d4a3e88..89e62cb 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_window_manager.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_window_manager.cc
@@ -48,7 +48,7 @@
for (aura::Window* window : added_windows_)
window->RemoveObserver(this);
added_windows_.clear();
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
display::Screen::GetScreen()->RemoveObserver(this);
EnableBackdropBehindTopWindowOnEachDisplay(false);
RemoveWindowCreationObservers();
@@ -206,7 +206,7 @@
AddWindowCreationObservers();
EnableBackdropBehindTopWindowOnEachDisplay(true);
display::Screen::GetScreen()->AddObserver(this);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
event_handler_ = WmShell::Get()->CreateMaximizeModeEventHandler();
}
@@ -276,7 +276,7 @@
DCHECK(observed_container_windows_.empty());
// Observe window activations/creations in the default containers on all root
// windows.
- for (aura::Window* root : Shell::GetInstance()->GetAllRootWindows()) {
+ for (aura::Window* root : Shell::Get()->GetAllRootWindows()) {
aura::Window* default_container =
root->GetChildById(kShellWindowId_DefaultContainer);
DCHECK(!base::ContainsKey(observed_container_windows_, default_container));
diff --git a/ash/common/wm/mru_window_tracker.cc b/ash/common/wm/mru_window_tracker.cc
index f8864bb0..57a392f 100644
--- a/ash/common/wm/mru_window_tracker.cc
+++ b/ash/common/wm/mru_window_tracker.cc
@@ -102,11 +102,11 @@
// MruWindowTracker, public:
MruWindowTracker::MruWindowTracker() : ignore_window_activations_(false) {
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
}
MruWindowTracker::~MruWindowTracker() {
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
for (WmWindow* window : mru_windows_)
window->aura_window()->RemoveObserver(this);
}
diff --git a/ash/common/wm/overview/window_selector.cc b/ash/common/wm/overview/window_selector.cc
index ede2565..369104f 100644
--- a/ash/common/wm/overview/window_selector.cc
+++ b/ash/common/wm/overview/window_selector.cc
@@ -306,12 +306,12 @@
DCHECK(!grid_list_.empty());
UMA_HISTOGRAM_COUNTS_100("Ash.WindowSelector.Items", num_items_);
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
display::Screen::GetScreen()->AddObserver(this);
shell->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW);
// Send an a11y alert.
- Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert(
+ Shell::Get()->accessibility_delegate()->TriggerAccessibilityAlert(
A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED);
UpdateShelfVisibility();
@@ -375,7 +375,7 @@
for (WmWindow* window : observed_windows_)
window->aura_window()->RemoveObserver(this);
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
display::Screen::GetScreen()->RemoveObserver(this);
if (restore_focus_window_)
restore_focus_window_->aura_window()->RemoveObserver(this);
diff --git a/ash/common/wm/overview/window_selector_controller.cc b/ash/common/wm/overview/window_selector_controller.cc
index ccf96490..95c78bc 100644
--- a/ash/common/wm/overview/window_selector_controller.cc
+++ b/ash/common/wm/overview/window_selector_controller.cc
@@ -65,7 +65,7 @@
if (windows.empty())
return false;
- Shell::GetInstance()->NotifyOverviewModeStarting();
+ Shell::Get()->NotifyOverviewModeStarting();
window_selector_.reset(new WindowSelector(this));
window_selector_->Init(windows);
OnSelectionStarted();
@@ -98,7 +98,7 @@
window_selector_->Shutdown();
window_selector_.reset();
last_selection_time_ = base::Time::Now();
- Shell::GetInstance()->NotifyOverviewModeEnded();
+ Shell::Get()->NotifyOverviewModeEnded();
}
void WindowSelectorController::AddDelayedAnimationObserver(
diff --git a/ash/common/wm/panels/panel_frame_view.cc b/ash/common/wm/panels/panel_frame_view.cc
index c6546d7..0cfefd0 100644
--- a/ash/common/wm/panels/panel_frame_view.cc
+++ b/ash/common/wm/panels/panel_frame_view.cc
@@ -28,11 +28,11 @@
DCHECK(!frame_->widget_delegate()->CanMaximize());
if (frame_type != FRAME_NONE)
InitHeaderPainter();
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
PanelFrameView::~PanelFrameView() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void PanelFrameView::SetFrameColors(SkColor active_frame_color,
diff --git a/ash/common/wm/panels/panel_layout_manager.cc b/ash/common/wm/panels/panel_layout_manager.cc
index c910aab..29d2759e 100644
--- a/ash/common/wm/panels/panel_layout_manager.cc
+++ b/ash/common/wm/panels/panel_layout_manager.cc
@@ -258,9 +258,9 @@
keyboard_observer_(this),
weak_factory_(this) {
DCHECK(panel_container);
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
WmShell::Get()->AddDisplayObserver(this);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
PanelLayoutManager::~PanelLayoutManager() {
@@ -290,9 +290,9 @@
}
panel_windows_.clear();
WmShell* shell = panel_container_->GetShell();
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
shell->RemoveDisplayObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void PanelLayoutManager::StartDragging(WmWindow* panel) {
diff --git a/ash/common/wm/screen_dimmer.cc b/ash/common/wm/screen_dimmer.cc
index 5986b5d..40b671d2 100644
--- a/ash/common/wm/screen_dimmer.cc
+++ b/ash/common/wm/screen_dimmer.cc
@@ -29,13 +29,13 @@
is_dimming_(false),
at_bottom_(false),
window_dimmers_(base::MakeUnique<WindowUserData<WindowDimmer>>()) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
ScreenDimmer::~ScreenDimmer() {
// Usage in chrome results in ScreenDimmer outliving the shell.
if (Shell::HasInstance())
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void ScreenDimmer::SetDimming(bool should_dim) {
diff --git a/ash/common/wm/window_positioning_utils.cc b/ash/common/wm/window_positioning_utils.cc
index 88e3246..99738613 100644
--- a/ash/common/wm/window_positioning_utils.cc
+++ b/ash/common/wm/window_positioning_utils.cc
@@ -179,8 +179,7 @@
// Restore focused/active window.
if (focused && tracker.Contains(focused->aura_window())) {
focused->SetFocused();
- Shell::GetInstance()->set_root_window_for_new_windows(
- focused->GetRootWindow());
+ Shell::Get()->set_root_window_for_new_windows(focused->GetRootWindow());
} else if (active && tracker.Contains(active->aura_window())) {
active->Activate();
}
diff --git a/ash/common/wm/workspace/workspace_layout_manager.cc b/ash/common/wm/workspace/workspace_layout_manager.cc
index 453a3b6..6766bc7 100644
--- a/ash/common/wm/workspace/workspace_layout_manager.cc
+++ b/ash/common/wm/workspace/workspace_layout_manager.cc
@@ -45,8 +45,8 @@
work_area_in_parent_(wm::GetDisplayWorkAreaBoundsInParent(window_)),
is_fullscreen_(wm::GetWindowForFullscreenMode(window) != nullptr),
keyboard_observer_(this) {
- Shell::GetInstance()->AddShellObserver(this);
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->AddShellObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
root_window_->aura_window()->AddObserver(this);
display::Screen::GetScreen()->AddObserver(this);
DCHECK(window->aura_window()->GetProperty(kSnapChildrenToPixelBoundary));
@@ -61,8 +61,8 @@
window->aura_window()->RemoveObserver(this);
}
display::Screen::GetScreen()->RemoveObserver(this);
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void WorkspaceLayoutManager::SetMaximizeBackdropDelegate(
@@ -380,8 +380,7 @@
return;
bool is_fullscreen = wm::GetWindowForFullscreenMode(window_) != nullptr;
if (is_fullscreen != is_fullscreen_) {
- Shell::GetInstance()->NotifyFullscreenStateChanged(is_fullscreen,
- root_window_);
+ Shell::Get()->NotifyFullscreenStateChanged(is_fullscreen, root_window_);
is_fullscreen_ = is_fullscreen;
}
}
diff --git a/ash/common/wm/workspace/workspace_layout_manager_unittest.cc b/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
index 4cb9806..fa34c20 100644
--- a/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
@@ -67,12 +67,10 @@
class TestShellObserver : public ShellObserver {
public:
TestShellObserver() : call_count_(0), is_fullscreen_(false) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
- ~TestShellObserver() override {
- Shell::GetInstance()->RemoveShellObserver(this);
- }
+ ~TestShellObserver() override { Shell::Get()->RemoveShellObserver(this); }
void OnFullscreenStateChanged(bool is_fullscreen,
WmWindow* root_window) override {
diff --git a/ash/common/wm_window.cc b/ash/common/wm_window.cc
index 151fc502..5216083 100644
--- a/ash/common/wm_window.cc
+++ b/ash/common/wm_window.cc
@@ -669,7 +669,7 @@
return;
}
ResizeShadowController* resize_shadow_controller =
- Shell::GetInstance()->resize_shadow_controller();
+ Shell::Get()->resize_shadow_controller();
if (resize_shadow_controller)
resize_shadow_controller->ShowShadow(window_, component);
}
@@ -680,7 +680,7 @@
return;
}
ResizeShadowController* resize_shadow_controller =
- Shell::GetInstance()->resize_shadow_controller();
+ Shell::Get()->resize_shadow_controller();
if (resize_shadow_controller)
resize_shadow_controller->HideShadow(window_);
}
diff --git a/ash/content/display/screen_orientation_controller_chromeos_unittest.cc b/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
index 9f8683c..ad389bf 100644
--- a/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
+++ b/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
@@ -63,20 +63,16 @@
}
bool RotationLocked() {
- return Shell::GetInstance()
- ->screen_orientation_controller()
- ->rotation_locked();
+ return Shell::Get()->screen_orientation_controller()->rotation_locked();
}
bool UserRotationLocked() {
- return Shell::GetInstance()
- ->screen_orientation_controller()
- ->user_rotation_locked();
+ return Shell::Get()->screen_orientation_controller()->user_rotation_locked();
}
void SetDisplayRotationById(int64_t display_id,
display::Display::Rotation rotation) {
- Shell::GetInstance()->display_manager()->SetDisplayRotation(
+ Shell::Get()->display_manager()->SetDisplayRotation(
display_id, rotation, display::Display::ROTATION_SOURCE_USER);
}
@@ -88,8 +84,7 @@
scoped_refptr<chromeos::AccelerometerUpdate> update(
new chromeos::AccelerometerUpdate());
update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, lid.x(), lid.y(), lid.z());
- Shell::GetInstance()->screen_orientation_controller()->OnAccelerometerUpdated(
- update);
+ Shell::Get()->screen_orientation_controller()->OnAccelerometerUpdated(update);
}
// Attaches the NativeView of |web_contents| to |parent| without changing the
@@ -106,7 +101,7 @@
void AttachAndActivateWebContents(content::WebContents* web_contents,
aura::Window* parent) {
AttachWebContents(web_contents, parent);
- Shell::GetInstance()->activation_client()->ActivateWindow(parent);
+ Shell::Get()->activation_client()->ActivateWindow(parent);
}
} // namespace
@@ -144,23 +139,20 @@
void SetSystemRotationLocked(bool rotation_locked) {
test::ScreenOrientationControllerTestApi(
- Shell::GetInstance()->screen_orientation_controller())
+ Shell::Get()->screen_orientation_controller())
.SetRotationLocked(rotation_locked);
}
void SetUserRotationLocked(bool rotation_locked) {
- if (Shell::GetInstance()
- ->screen_orientation_controller()
- ->user_rotation_locked() != rotation_locked) {
- Shell::GetInstance()
- ->screen_orientation_controller()
- ->ToggleUserRotationLock();
+ if (Shell::Get()->screen_orientation_controller()->user_rotation_locked() !=
+ rotation_locked) {
+ Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock();
}
}
blink::WebScreenOrientationLockType UserLockedOrientation() const {
test::ScreenOrientationControllerTestApi test_api(
- Shell::GetInstance()->screen_orientation_controller());
+ Shell::Get()->screen_orientation_controller());
return test_api.UserLockedOrientation();
}
@@ -292,7 +284,7 @@
ASSERT_TRUE(RotationLocked());
aura::client::ActivationClient* activation_client =
- Shell::GetInstance()->activation_client();
+ Shell::Get()->activation_client();
activation_client->ActivateWindow(focus_window2.get());
EXPECT_FALSE(RotationLocked());
@@ -315,7 +307,7 @@
EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation());
aura::client::ActivationClient* activation_client =
- Shell::GetInstance()->activation_client();
+ Shell::Get()->activation_client();
activation_client->ActivateWindow(focus_window2.get());
EXPECT_TRUE(RotationLocked());
EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
@@ -358,7 +350,7 @@
EXPECT_FALSE(RotationLocked());
aura::client::ActivationClient* activation_client =
- Shell::GetInstance()->activation_client();
+ Shell::Get()->activation_client();
activation_client->ActivateWindow(focus_window2.get());
EXPECT_FALSE(RotationLocked());
@@ -454,9 +446,8 @@
// triggered by the accelerometer.
TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) {
EnableMaximizeMode(true);
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
display::test::DisplayManagerTestApi(display_manager())
.SetFirstDisplayAsInternalDisplay();
@@ -692,7 +683,7 @@
->GetDisplayInfo(kInternalDisplayId)
.GetActiveRotation());
test::ScreenOrientationControllerTestApi(
- Shell::GetInstance()->screen_orientation_controller())
+ Shell::Get()->screen_orientation_controller())
.SetDisplayRotation(kNewRotation,
display::Display::ROTATION_SOURCE_ACTIVE);
@@ -703,7 +694,7 @@
TEST_F(ScreenOrientationControllerTest, UserRotationLockedOrientation) {
ScreenOrientationController* orientation_controller =
- Shell::GetInstance()->screen_orientation_controller();
+ Shell::Get()->screen_orientation_controller();
orientation_controller->ToggleUserRotationLock();
EXPECT_TRUE(orientation_controller->user_rotation_locked());
EXPECT_EQ(blink::WebScreenOrientationLockLandscapePrimary,
@@ -771,7 +762,7 @@
ASSERT_FALSE(UserRotationLocked());
ScreenOrientationController* orientation_controller =
- Shell::GetInstance()->screen_orientation_controller();
+ Shell::Get()->screen_orientation_controller();
ASSERT_FALSE(orientation_controller->user_rotation_locked());
orientation_controller->ToggleUserRotationLock();
ASSERT_TRUE(orientation_controller->user_rotation_locked());
@@ -781,7 +772,7 @@
EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
aura::client::ActivationClient* activation_client =
- Shell::GetInstance()->activation_client();
+ Shell::Get()->activation_client();
// Activating any will switch to the natural orientation.
activation_client->ActivateWindow(focus_window2.get());
EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation());
diff --git a/ash/content/keyboard_overlay/keyboard_overlay_view.cc b/ash/content/keyboard_overlay/keyboard_overlay_view.cc
index c09e038..a05d38b 100644
--- a/ash/content/keyboard_overlay/keyboard_overlay_view.cc
+++ b/ash/content/keyboard_overlay/keyboard_overlay_view.cc
@@ -37,7 +37,7 @@
KeyboardOverlayView::~KeyboardOverlayView() {}
void KeyboardOverlayView::Cancel() {
- Shell::GetInstance()->overlay_filter()->Deactivate(this);
+ Shell::Get()->overlay_filter()->Deactivate(this);
views::Widget* widget = GetWidget();
if (widget)
widget->Close();
@@ -66,7 +66,7 @@
void KeyboardOverlayView::ShowDialog(content::BrowserContext* context,
WebContentsHandler* handler,
const GURL& url) {
- if (Shell::GetInstance()->overlay_filter()->IsActive())
+ if (Shell::Get()->overlay_filter()->IsActive())
return;
KeyboardOverlayDelegate* delegate = new KeyboardOverlayDelegate(
@@ -75,7 +75,7 @@
new KeyboardOverlayView(context, delegate, handler);
delegate->Show(view);
- Shell::GetInstance()->overlay_filter()->Activate(view);
+ Shell::Get()->overlay_filter()->Activate(view);
}
void KeyboardOverlayView::WindowClosing() {
diff --git a/ash/content/screen_orientation_delegate_chromeos.cc b/ash/content/screen_orientation_delegate_chromeos.cc
index a946257..12b59c8 100644
--- a/ash/content/screen_orientation_delegate_chromeos.cc
+++ b/ash/content/screen_orientation_delegate_chromeos.cc
@@ -27,25 +27,21 @@
void ScreenOrientationDelegateChromeos::Lock(
content::WebContents* web_contents,
blink::WebScreenOrientationLockType lock_orientation) {
- Shell::GetInstance()
- ->screen_orientation_controller()
- ->LockOrientationForWindow(
- WmWindow::Get(web_contents->GetNativeView()), lock_orientation,
- ScreenOrientationController::LockCompletionBehavior::None);
+ Shell::Get()->screen_orientation_controller()->LockOrientationForWindow(
+ WmWindow::Get(web_contents->GetNativeView()), lock_orientation,
+ ScreenOrientationController::LockCompletionBehavior::None);
}
bool ScreenOrientationDelegateChromeos::ScreenOrientationProviderSupported() {
- return Shell::GetInstance()
+ return Shell::Get()
->screen_orientation_controller()
->ScreenOrientationProviderSupported();
}
void ScreenOrientationDelegateChromeos::Unlock(
content::WebContents* web_contents) {
- Shell::GetInstance()
- ->screen_orientation_controller()
- ->UnlockOrientationForWindow(
- WmWindow::Get(web_contents->GetNativeView()));
+ Shell::Get()->screen_orientation_controller()->UnlockOrientationForWindow(
+ WmWindow::Get(web_contents->GetNativeView()));
}
} // namespace ash
diff --git a/ash/debug.cc b/ash/debug.cc
index fe37889..9ffce24 100644
--- a/ash/debug.cc
+++ b/ash/debug.cc
@@ -13,8 +13,7 @@
namespace debug {
void ToggleShowDebugBorders() {
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
std::unique_ptr<bool> value;
for (aura::Window::Windows::iterator it = root_windows.begin();
it != root_windows.end(); ++it) {
@@ -28,8 +27,7 @@
}
void ToggleShowFpsCounter() {
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
std::unique_ptr<bool> value;
for (aura::Window::Windows::iterator it = root_windows.begin();
it != root_windows.end(); ++it) {
@@ -43,8 +41,7 @@
}
void ToggleShowPaintRects() {
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
std::unique_ptr<bool> value;
for (aura::Window::Windows::iterator it = root_windows.begin();
it != root_windows.end(); ++it) {
diff --git a/ash/default_wallpaper_delegate.cc b/ash/default_wallpaper_delegate.cc
index 48c28b48..6931faa 100644
--- a/ash/default_wallpaper_delegate.cc
+++ b/ash/default_wallpaper_delegate.cc
@@ -28,7 +28,7 @@
void DefaultWallpaperDelegate::UpdateWallpaper(bool clear_cache) {}
void DefaultWallpaperDelegate::InitializeWallpaper() {
- Shell::GetInstance()->wallpaper_controller()->CreateEmptyWallpaper();
+ Shell::Get()->wallpaper_controller()->CreateEmptyWallpaper();
}
bool DefaultWallpaperDelegate::CanOpenSetWallpaperPage() {
diff --git a/ash/dip_unittest.cc b/ash/dip_unittest.cc
index 0e1abed3..0bdbdc7 100644
--- a/ash/dip_unittest.cc
+++ b/ash/dip_unittest.cc
@@ -48,7 +48,7 @@
const display::Display display_2x = screen->GetDisplayNearestWindow(root);
const display::ManagedDisplayInfo display_info_2x =
- Shell::GetInstance()->display_manager()->GetDisplayInfo(display_2x.id());
+ Shell::Get()->display_manager()->GetDisplayInfo(display_2x.id());
// The |bounds_in_pixel()| should report bounds in pixel coordinate.
EXPECT_EQ("1,1 2000x1800", display_info_2x.bounds_in_native().ToString());
diff --git a/ash/display/cursor_window_controller.cc b/ash/display/cursor_window_controller.cc
index 4c654c5..46cb1587 100644
--- a/ash/display/cursor_window_controller.cc
+++ b/ash/display/cursor_window_controller.cc
@@ -138,7 +138,7 @@
if (display.is_valid())
SetDisplay(display);
} else {
- aura::Window* mirror_window = Shell::GetInstance()
+ aura::Window* mirror_window = Shell::Get()
->window_tree_host_manager()
->mirror_window_controller()
->GetWindow();
@@ -156,15 +156,15 @@
// TODO(oshima): Do not updatethe composition cursor when crossing
// display in unified desktop mode for now. crbug.com/517222.
- if (Shell::GetInstance()->display_manager()->IsInUnifiedMode() &&
+ if (Shell::Get()->display_manager()->IsInUnifiedMode() &&
display.id() != display::DisplayManager::kUnifiedDisplayId) {
return;
}
display_ = display;
- aura::Window* root_window = Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display.id());
+ aura::Window* root_window =
+ Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display.id());
if (!root_window)
return;
@@ -244,7 +244,7 @@
} else {
// Use the original device scale factor instead of the display's, which
// might have been adjusted for the UI scale.
- const float original_scale = Shell::GetInstance()
+ const float original_scale = Shell::Get()
->display_manager()
->GetDisplayInfo(display_.id())
.device_scale_factor();
diff --git a/ash/display/cursor_window_controller_unittest.cc b/ash/display/cursor_window_controller_unittest.cc
index bb87800..3609b64 100644
--- a/ash/display/cursor_window_controller_unittest.cc
+++ b/ash/display/cursor_window_controller_unittest.cc
@@ -49,9 +49,8 @@
}
void SetCursorCompositionEnabled(bool enabled) {
- cursor_window_controller_ = Shell::GetInstance()
- ->window_tree_host_manager()
- ->cursor_window_controller();
+ cursor_window_controller_ =
+ Shell::Get()->window_tree_host_manager()->cursor_window_controller();
cursor_window_controller_->SetCursorCompositingEnabled(enabled);
}
@@ -68,7 +67,7 @@
UpdateDisplay("200x200,200x200*2/r");
WindowTreeHostManager* window_tree_host_manager =
- Shell::GetInstance()->window_tree_host_manager();
+ Shell::Get()->window_tree_host_manager();
int64_t primary_display_id = window_tree_host_manager->GetPrimaryDisplayId();
int64_t secondary_display_id = display_manager()->GetSecondaryDisplay().id();
aura::Window* primary_root =
@@ -119,7 +118,7 @@
TEST_F(CursorWindowControllerTest, VisibilityTest) {
ASSERT_TRUE(GetCursorWindow());
EXPECT_TRUE(GetCursorWindow()->IsVisible());
- aura::client::CursorClient* client = Shell::GetInstance()->cursor_manager();
+ aura::client::CursorClient* client = Shell::Get()->cursor_manager();
client->HideCursor();
ASSERT_TRUE(GetCursorWindow());
EXPECT_FALSE(GetCursorWindow()->IsVisible());
diff --git a/ash/display/display_animator_chromeos.cc b/ash/display/display_animator_chromeos.cc
index fee1bf4..d7956d2 100644
--- a/ash/display/display_animator_chromeos.cc
+++ b/ash/display/display_animator_chromeos.cc
@@ -93,11 +93,11 @@
} // namespace
DisplayAnimatorChromeOS::DisplayAnimatorChromeOS() : weak_ptr_factory_(this) {
- Shell::GetInstance()->display_configurator()->AddObserver(this);
+ Shell::Get()->display_configurator()->AddObserver(this);
}
DisplayAnimatorChromeOS::~DisplayAnimatorChromeOS() {
- Shell::GetInstance()->display_configurator()->RemoveObserver(this);
+ Shell::Get()->display_configurator()->RemoveObserver(this);
ClearHidingLayers();
}
@@ -109,7 +109,7 @@
// hiding the root windows, we put a black layer over a root window for
// safety. These layers remain to hide root windows and will be deleted
// after the animation of OnDisplayModeChanged().
- for (aura::Window* root_window : Shell::GetInstance()->GetAllRootWindows()) {
+ for (aura::Window* root_window : Shell::Get()->GetAllRootWindows()) {
std::unique_ptr<ui::Layer> hiding_layer =
base::MakeUnique<ui::Layer>(ui::LAYER_SOLID_COLOR);
hiding_layer->SetColor(SK_ColorBLACK);
@@ -158,7 +158,7 @@
// Schedules the fade-in effect for all root windows. Because we put the
// black layers for fade-out, here we actually turn those black layers
// invisible.
- for (aura::Window* root_window : Shell::GetInstance()->GetAllRootWindows()) {
+ for (aura::Window* root_window : Shell::Get()->GetAllRootWindows()) {
ui::Layer* hiding_layer = nullptr;
if (hiding_layers_.find(root_window) == hiding_layers_.end()) {
// In case of the transition from mirroring->non-mirroring, new root
diff --git a/ash/display/display_configuration_controller_unittest.cc b/ash/display/display_configuration_controller_unittest.cc
index 652b2661..bd3a8b3 100644
--- a/ash/display/display_configuration_controller_unittest.cc
+++ b/ash/display/display_configuration_controller_unittest.cc
@@ -29,12 +29,12 @@
display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
test::DisplayConfigurationControllerTestApi testapi(
- Shell::GetInstance()->display_configuration_controller());
+ Shell::Get()->display_configuration_controller());
ScreenRotationAnimator* screen_rotation_animator =
testapi.GetScreenRotationAnimatorForDisplay(display.id());
EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize());
- Shell::GetInstance()->display_manager()->SetDisplayRotation(
+ Shell::Get()->display_manager()->SetDisplayRotation(
display.id(), display::Display::ROTATE_0,
display::Display::RotationSource::ROTATION_SOURCE_USER);
screen_rotation_animator->Rotate(
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index 6822c7da..7280626 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -975,8 +975,7 @@
TEST_F(DisplayManagerTest, NoMirrorInThreeDisplays) {
UpdateDisplay("640x480,320x200,400x300");
- ash::Shell::GetInstance()->display_configuration_controller()->SetMirrorMode(
- true);
+ ash::Shell::Get()->display_configuration_controller()->SetMirrorMode(true);
EXPECT_FALSE(display_manager()->IsInMirrorMode());
EXPECT_EQ(3u, display_manager()->GetNumDisplays());
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_MIRRORING_NOT_SUPPORTED),
@@ -1062,7 +1061,7 @@
updated_display_info2.GetOverscanInsetsInPixel().ToString());
// Make sure switching primary display applies the overscan offset only once.
- ash::Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId(
+ ash::Shell::Get()->window_tree_host_manager()->SetPrimaryDisplayId(
display_manager()->GetSecondaryDisplay().id());
EXPECT_EQ("-500,0 500x500",
display_manager()->GetSecondaryDisplay().bounds().ToString());
@@ -1452,7 +1451,7 @@
GetDisplayForId(internal_display_id).bounds().ToString());
EXPECT_EQ("500,0 100x100", GetDisplayForId(10).bounds().ToString());
- ash::Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId(
+ ash::Shell::Get()->window_tree_host_manager()->SetPrimaryDisplayId(
secondary_display_info.id());
EXPECT_EQ("-500,0 500x500",
GetDisplayForId(internal_display_id).bounds().ToString());
@@ -2236,7 +2235,7 @@
EXPECT_TRUE(display_manager()->IsInMirrorMode());
EXPECT_EQ(1U, display_manager()->GetNumDisplays());
WindowTreeHostManager* window_tree_host_manager =
- ash::Shell::GetInstance()->window_tree_host_manager();
+ ash::Shell::Get()->window_tree_host_manager();
EXPECT_TRUE(
window_tree_host_manager->mirror_window_controller()->GetWindow());
@@ -2264,7 +2263,7 @@
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
EXPECT_FALSE(root_windows[0]->Contains(test_api.GetCursorWindow()));
- Shell::GetInstance()->SetCursorCompositingEnabled(true);
+ Shell::Get()->SetCursorCompositingEnabled(true);
EXPECT_TRUE(root_windows[0]->Contains(test_api.GetCursorWindow()));
@@ -2277,7 +2276,7 @@
root_windows = Shell::GetAllRootWindows();
EXPECT_TRUE(root_windows[0]->Contains(test_api.GetCursorWindow()));
- Shell::GetInstance()->SetCursorCompositingEnabled(false);
+ Shell::Get()->SetCursorCompositingEnabled(false);
}
TEST_F(DisplayManagerTest, MirroredLayout) {
@@ -2394,8 +2393,7 @@
TEST_F(DisplayManagerTest, UpdateDisplayWithHostOrigin) {
UpdateDisplay("100x200,300x400");
ASSERT_EQ(2, display::Screen::GetScreen()->GetNumDisplays());
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
ASSERT_EQ(2U, root_windows.size());
aura::WindowTreeHost* host0 = root_windows[0]->GetHost();
aura::WindowTreeHost* host1 = root_windows[1]->GetHost();
diff --git a/ash/display/display_util.cc b/ash/display/display_util.cc
index bb2c0a60..8573520e 100644
--- a/ash/display/display_util.cc
+++ b/ash/display/display_util.cc
@@ -150,7 +150,7 @@
if (update_last_location_now) {
gfx::Point new_point_in_screen;
- if (Shell::GetInstance()->display_manager()->IsInUnifiedMode()) {
+ if (Shell::Get()->display_manager()->IsInUnifiedMode()) {
new_point_in_screen = point_in_host;
// First convert to the unified host.
host->ConvertPixelsToDIP(&new_point_in_screen);
diff --git a/ash/display/extended_mouse_warp_controller.cc b/ash/display/extended_mouse_warp_controller.cc
index c83bf07..ac31b33b 100644
--- a/ash/display/extended_mouse_warp_controller.cc
+++ b/ash/display/extended_mouse_warp_controller.cc
@@ -36,9 +36,8 @@
// Helper method that maps a display::Display to an aura::Window.
aura::Window* GetRootWindowForDisplayId(int64_t display_id) {
- return Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display_id);
+ return Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display_id);
}
// Helper method that maps an aura::Window to display id;
@@ -101,8 +100,7 @@
ExtendedMouseWarpController::ExtendedMouseWarpController(
aura::Window* drag_source)
: drag_source_root_(drag_source), allow_non_native_event_(false) {
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
int64_t drag_source_id = drag_source ? GetDisplayIdFromWindow(drag_source)
: display::kInvalidDisplayId;
display::Displays display_list = display_manager->active_display_list();
diff --git a/ash/display/extended_mouse_warp_controller_unittest.cc b/ash/display/extended_mouse_warp_controller_unittest.cc
index ccc276a..9160864 100644
--- a/ash/display/extended_mouse_warp_controller_unittest.cc
+++ b/ash/display/extended_mouse_warp_controller_unittest.cc
@@ -24,7 +24,7 @@
protected:
MouseCursorEventFilter* event_filter() {
- return Shell::GetInstance()->mouse_cursor_filter();
+ return Shell::Get()->mouse_cursor_filter();
}
ExtendedMouseWarpController* mouse_warp_controller() {
diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc
index 035ab953..858dc66 100644
--- a/ash/display/mirror_window_controller.cc
+++ b/ash/display/mirror_window_controller.cc
@@ -114,8 +114,7 @@
};
display::DisplayManager::MultiDisplayMode GetCurrentMultiDisplayMode() {
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
return display_manager->IsInUnifiedMode()
? display::DisplayManager::UNIFIED
: (display_manager->IsInMirrorMode()
@@ -148,8 +147,7 @@
void MirrorWindowController::UpdateWindow(
const std::vector<display::ManagedDisplayInfo>& display_info_list) {
static int mirror_host_count = 0;
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
const display::Display& primary =
display::Screen::GetScreen()->GetPrimaryDisplay();
const display::ManagedDisplayInfo& source_display_info =
@@ -181,13 +179,13 @@
aura::WindowTreeHost* host = host_info->ash_host->AsWindowTreeHost();
host->SetSharedInputMethod(
- Shell::GetInstance()->window_tree_host_manager()->input_method());
+ Shell::Get()->window_tree_host_manager()->input_method());
host->window()->SetName(
base::StringPrintf("MirrorRootWindow-%d", mirror_host_count++));
host->compositor()->SetBackgroundColor(SK_ColorBLACK);
// No need to remove the observer because the WindowTreeHostManager
// outlives the host.
- host->AddObserver(Shell::GetInstance()->window_tree_host_manager());
+ host->AddObserver(Shell::Get()->window_tree_host_manager());
host->AddObserver(this);
// TODO(oshima): TouchHUD is using idkey.
InitRootWindowSettings(host->window())->display_id = display_info.id();
@@ -203,7 +201,7 @@
if (display_manager->IsInUnifiedMode()) {
host_info->ash_host->ConfineCursorToRootWindow();
AshWindowTreeHost* unified_ash_host =
- Shell::GetInstance()
+ Shell::Get()
->window_tree_host_manager()
->GetAshWindowTreeHostForDisplayId(
display::Screen::GetScreen()->GetPrimaryDisplay().id());
@@ -262,8 +260,7 @@
void MirrorWindowController::UpdateWindow() {
if (mirroring_host_info_map_.empty())
return;
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
std::vector<display::ManagedDisplayInfo> display_info_list;
for (auto& pair : mirroring_host_info_map_)
display_info_list.push_back(display_manager->GetDisplayInfo(pair.first));
@@ -300,7 +297,7 @@
reflector_->OnMirroringCompositorResized();
// No need to update the transformer as new transformer is already set
// in UpdateWindow.
- Shell::GetInstance()
+ Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->UpdateLocation();
@@ -310,8 +307,7 @@
}
aura::Window* MirrorWindowController::GetWindow() {
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
if (!display_manager->IsInMirrorMode() || mirroring_host_info_map_.empty())
return nullptr;
DCHECK_EQ(1U, mirroring_host_info_map_.size());
@@ -326,9 +322,8 @@
if (pair.second->ash_host->AsWindowTreeHost()->window() == root) {
// Sanity check to catch an error early.
int64_t id = pair.first;
- const display::Displays& list = Shell::GetInstance()
- ->display_manager()
- ->software_mirroring_display_list();
+ const display::Displays& list =
+ Shell::Get()->display_manager()->software_mirroring_display_list();
auto iter = std::find_if(
list.begin(), list.end(),
[id](const display::Display& display) { return display.id() == id; });
@@ -364,7 +359,7 @@
aura::client::SetCaptureClient(host->window(), nullptr);
delete capture_client;
- host->RemoveObserver(Shell::GetInstance()->window_tree_host_manager());
+ host->RemoveObserver(Shell::Get()->window_tree_host_manager());
host->RemoveObserver(this);
host_info->ash_host->PrepareForShutdown();
reflector_->RemoveMirroringLayer(host_info->mirror_window->layer());
diff --git a/ash/display/mirror_window_controller_unittest.cc b/ash/display/mirror_window_controller_unittest.cc
index 321381e..55fce11 100644
--- a/ash/display/mirror_window_controller_unittest.cc
+++ b/ash/display/mirror_window_controller_unittest.cc
@@ -78,7 +78,7 @@
display_manager()->SetMultiDisplayMode(display::DisplayManager::MIRRORING);
UpdateDisplay("400x400,400x400");
- aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root = Shell::Get()->GetPrimaryRootWindow();
std::unique_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate(
&test_window_delegate, 0, gfx::Rect(50, 50, 100, 100), root));
window->Show();
@@ -124,7 +124,7 @@
display_manager()->SetMultiDisplayMode(display::DisplayManager::MIRRORING);
UpdateDisplay("400x400,400x400");
- aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root = Shell::Get()->GetPrimaryRootWindow();
std::unique_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate(
&test_window_delegate, 0, gfx::Rect(50, 50, 100, 100), root));
window->Show();
@@ -178,7 +178,7 @@
// Test with device scale factor.
UpdateDisplay("400x600*2,400x600");
- aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root = Shell::Get()->GetPrimaryRootWindow();
ui::test::EventGenerator generator(root);
generator.MoveMouseToInHost(10, 20);
@@ -207,7 +207,7 @@
// cursor's display.
TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorMoveOnEnter) {
aura::Env* env = aura::Env::GetInstance();
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
WindowTreeHostManager* window_tree_host_manager =
shell->window_tree_host_manager();
diff --git a/ash/display/mouse_cursor_event_filter.cc b/ash/display/mouse_cursor_event_filter.cc
index 0844e0a..8cea699d 100644
--- a/ash/display/mouse_cursor_event_filter.cc
+++ b/ash/display/mouse_cursor_event_filter.cc
@@ -16,16 +16,16 @@
namespace ash {
MouseCursorEventFilter::MouseCursorEventFilter() : mouse_warp_enabled_(true) {
- Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ Shell::Get()->window_tree_host_manager()->AddObserver(this);
}
MouseCursorEventFilter::~MouseCursorEventFilter() {
- Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
+ Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
}
void MouseCursorEventFilter::ShowSharedEdgeIndicator(aura::Window* from) {
- mouse_warp_controller_ = ash::CreateMouseWarpController(
- Shell::GetInstance()->display_manager(), from);
+ mouse_warp_controller_ =
+ ash::CreateMouseWarpController(Shell::Get()->display_manager(), from);
}
void MouseCursorEventFilter::HideSharedEdgeIndicator() {
@@ -37,8 +37,8 @@
}
void MouseCursorEventFilter::OnDisplayConfigurationChanged() {
- mouse_warp_controller_ = ash::CreateMouseWarpController(
- Shell::GetInstance()->display_manager(), nullptr);
+ mouse_warp_controller_ =
+ ash::CreateMouseWarpController(Shell::Get()->display_manager(), nullptr);
}
void MouseCursorEventFilter::OnMouseEvent(ui::MouseEvent* event) {
@@ -54,7 +54,7 @@
return;
}
- Shell::GetInstance()
+ Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->UpdateLocation();
diff --git a/ash/display/mouse_cursor_event_filter_unittest.cc b/ash/display/mouse_cursor_event_filter_unittest.cc
index 73812e1..d1139c4 100644
--- a/ash/display/mouse_cursor_event_filter_unittest.cc
+++ b/ash/display/mouse_cursor_event_filter_unittest.cc
@@ -22,7 +22,7 @@
protected:
MouseCursorEventFilter* event_filter() {
- return Shell::GetInstance()->mouse_cursor_filter();
+ return Shell::Get()->mouse_cursor_filter();
}
bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) {
@@ -39,7 +39,7 @@
TEST_F(MouseCursorEventFilterTest, WarpMouse) {
UpdateDisplay("500x500,500x500");
- ASSERT_EQ(display::DisplayPlacement::RIGHT, Shell::GetInstance()
+ ASSERT_EQ(display::DisplayPlacement::RIGHT, Shell::Get()
->display_manager()
->GetCurrentDisplayLayout()
.placement_list[0]
@@ -76,7 +76,7 @@
TEST_F(MouseCursorEventFilterTest, WarpMouseDifferentSizeDisplays) {
UpdateDisplay("500x500,600x600"); // the second one is larger.
- ASSERT_EQ(display::DisplayPlacement::RIGHT, Shell::GetInstance()
+ ASSERT_EQ(display::DisplayPlacement::RIGHT, Shell::Get()
->display_manager()
->GetCurrentDisplayLayout()
.placement_list[0]
@@ -101,7 +101,7 @@
TEST_F(MouseCursorEventFilterTest, WarpMouseDifferentScaleDisplaysInNative) {
UpdateDisplay("500x500,600x600*2");
- ASSERT_EQ(display::DisplayPlacement::RIGHT, Shell::GetInstance()
+ ASSERT_EQ(display::DisplayPlacement::RIGHT, Shell::Get()
->display_manager()
->GetCurrentDisplayLayout()
.placement_list[0]
@@ -145,8 +145,7 @@
display_manager()->SetLayoutForCurrentDisplays(
display::test::CreateDisplayLayout(display_manager(),
display::DisplayPlacement::RIGHT, 0));
- test::CursorManagerTestApi cursor_test_api(
- Shell::GetInstance()->cursor_manager());
+ test::CursorManagerTestApi cursor_test_api(Shell::Get()->cursor_manager());
EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
TestIfMouseWarpsAt(gfx::Point(399, 200));
diff --git a/ash/display/resolution_notification_controller.cc b/ash/display/resolution_notification_controller.cc
index 9775277..f4fcece 100644
--- a/ash/display/resolution_notification_controller.cc
+++ b/ash/display/resolution_notification_controller.cc
@@ -138,8 +138,7 @@
new_resolution(new_resolution),
accept_callback(accept_callback),
timeout_count(0) {
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
if (!display::Display::HasInternalDisplay() &&
display_manager->num_connected_displays() == 1u) {
timeout_count = kTimeoutInSec;
@@ -154,12 +153,12 @@
}
ResolutionNotificationController::ResolutionNotificationController() {
- Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ Shell::Get()->window_tree_host_manager()->AddObserver(this);
display::Screen::GetScreen()->AddObserver(this);
}
ResolutionNotificationController::~ResolutionNotificationController() {
- Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
+ Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
display::Screen::GetScreen()->RemoveObserver(this);
}
@@ -216,8 +215,8 @@
data.should_make_spoken_feedback_for_popup_updates = enable_spoken_feedback;
- const base::string16 display_name = base::UTF8ToUTF16(
- Shell::GetInstance()->display_manager()->GetDisplayNameForId(
+ const base::string16 display_name =
+ base::UTF8ToUTF16(Shell::Get()->display_manager()->GetDisplayNameForId(
change_info_->display_id));
const base::string16 message =
(change_info_->new_resolution->size() ==
@@ -281,8 +280,7 @@
scoped_refptr<display::ManagedDisplayMode> old_resolution =
change_info_->old_resolution;
change_info_.reset();
- Shell::GetInstance()->display_manager()->SetDisplayMode(display_id,
- old_resolution);
+ Shell::Get()->display_manager()->SetDisplayMode(display_id, old_resolution);
}
void ResolutionNotificationController::OnDisplayAdded(
@@ -303,7 +301,7 @@
return;
change_info_->current_resolution =
- Shell::GetInstance()->display_manager()->GetActiveModeForDisplayId(
+ Shell::Get()->display_manager()->GetActiveModeForDisplayId(
change_info_->display_id);
CreateOrUpdateNotification(true);
if (g_use_timer && change_info_->timeout_count > 0) {
diff --git a/ash/display/resolution_notification_controller_unittest.cc b/ash/display/resolution_notification_controller_unittest.cc
index 30a7295..0c43487b 100644
--- a/ash/display/resolution_notification_controller_unittest.cc
+++ b/ash/display/resolution_notification_controller_unittest.cc
@@ -132,7 +132,7 @@
static void TickTimer() { controller()->OnTimerTick(); }
static ResolutionNotificationController* controller() {
- return Shell::GetInstance()->resolution_notification_controller();
+ return Shell::Get()->resolution_notification_controller();
}
int accept_count() const { return accept_count_; }
diff --git a/ash/display/root_window_transformers.cc b/ash/display/root_window_transformers.cc
index 2cb292f..ca1225e0 100644
--- a/ash/display/root_window_transformers.cc
+++ b/ash/display/root_window_transformers.cc
@@ -54,7 +54,7 @@
gfx::Transform CreateRotationTransform(aura::Window* root_window,
const display::Display& display) {
display::ManagedDisplayInfo info =
- Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id());
+ Shell::Get()->display_manager()->GetDisplayInfo(display.id());
// TODO(oshima): Add animation. (crossfade+rotation, or just cross-fade)
#if defined(OS_WIN)
@@ -96,8 +96,7 @@
}
gfx::Transform CreateMagnifierTransform(aura::Window* root_window) {
- MagnificationController* magnifier =
- Shell::GetInstance()->magnification_controller();
+ MagnificationController* magnifier = Shell::Get()->magnification_controller();
float magnifier_scale = 1.f;
gfx::Point magnifier_offset;
if (magnifier && magnifier->IsEnabled()) {
@@ -138,8 +137,7 @@
public:
AshRootWindowTransformer(aura::Window* root, const display::Display& display)
: root_window_(root) {
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
display::ManagedDisplayInfo info =
display_manager->GetDisplayInfo(display.id());
host_insets_ = info.GetOverscanInsetsInPixel();
@@ -282,7 +280,7 @@
display::Display unified_display =
display::Screen::GetScreen()->GetPrimaryDisplay();
display::ManagedDisplayInfo display_info =
- Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id());
+ Shell::Get()->display_manager()->GetDisplayInfo(display.id());
root_bounds_ = gfx::Rect(display_info.bounds_in_native().size());
float scale = root_bounds_.height() /
static_cast<float>(screen_bounds.height()) /
diff --git a/ash/display/root_window_transformers_unittest.cc b/ash/display/root_window_transformers_unittest.cc
index fdcc28b..60617a1e 100644
--- a/ash/display/root_window_transformers_unittest.cc
+++ b/ash/display/root_window_transformers_unittest.cc
@@ -154,11 +154,10 @@
#endif
TEST_F(RootWindowTransformersTest, MAYBE_RotateAndMagnify) {
- MagnificationController* magnifier =
- Shell::GetInstance()->magnification_controller();
+ MagnificationController* magnifier = Shell::Get()->magnification_controller();
TestEventHandler event_handler;
- Shell::GetInstance()->AddPreTargetHandler(&event_handler);
+ Shell::Get()->AddPreTargetHandler(&event_handler);
UpdateDisplay("120x200,300x400*2");
display::Display display1 = display::Screen::GetScreen()->GetPrimaryDisplay();
@@ -251,12 +250,12 @@
GetActiveDisplayRotation(display2_id));
magnifier->SetEnabled(false);
- Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ Shell::Get()->RemovePreTargetHandler(&event_handler);
}
TEST_F(RootWindowTransformersTest, ScaleAndMagnify) {
TestEventHandler event_handler;
- Shell::GetInstance()->AddPreTargetHandler(&event_handler);
+ Shell::Get()->AddPreTargetHandler(&event_handler);
UpdateDisplay("600x400*[email protected],500x300");
@@ -265,8 +264,7 @@
display1.id());
display::Display display2 = display_manager()->GetSecondaryDisplay();
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
- MagnificationController* magnifier =
- Shell::GetInstance()->magnification_controller();
+ MagnificationController* magnifier = Shell::Get()->magnification_controller();
magnifier->SetEnabled(true);
EXPECT_EQ(2.0f, magnifier->GetScale());
@@ -294,20 +292,19 @@
EXPECT_EQ(1.0f, GetStoredUIScale(display2.id()));
magnifier->SetEnabled(false);
- Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ Shell::Get()->RemovePreTargetHandler(&event_handler);
}
TEST_F(RootWindowTransformersTest, MAYBE_TouchScaleAndMagnify) {
TestEventHandler event_handler;
- Shell::GetInstance()->AddPreTargetHandler(&event_handler);
+ Shell::Get()->AddPreTargetHandler(&event_handler);
UpdateDisplay("200x200*2");
display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
aura::Window* root_window = root_windows[0];
ui::test::EventGenerator generator(root_window);
- MagnificationController* magnifier =
- Shell::GetInstance()->magnification_controller();
+ MagnificationController* magnifier = Shell::Get()->magnification_controller();
magnifier->SetEnabled(true);
EXPECT_FLOAT_EQ(2.0f, magnifier->GetScale());
@@ -330,14 +327,13 @@
event_handler.scroll_y_offset_ordinal());
magnifier->SetEnabled(false);
- Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ Shell::Get()->RemovePreTargetHandler(&event_handler);
}
TEST_F(RootWindowTransformersTest, MAYBE_ConvertHostToRootCoords) {
TestEventHandler event_handler;
- Shell::GetInstance()->AddPreTargetHandler(&event_handler);
- MagnificationController* magnifier =
- Shell::GetInstance()->magnification_controller();
+ Shell::Get()->AddPreTargetHandler(&event_handler);
+ MagnificationController* magnifier = Shell::Get()->magnification_controller();
// Test 1
UpdateDisplay("600x400*2/[email protected]");
@@ -416,7 +412,7 @@
magnifier->SetEnabled(false);
EXPECT_FLOAT_EQ(1.0f, magnifier->GetScale());
- Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ Shell::Get()->RemovePreTargetHandler(&event_handler);
}
TEST_F(RootWindowTransformersTest, LetterBoxPillarBox) {
diff --git a/ash/display/screen_ash.cc b/ash/display/screen_ash.cc
index a248668..b8bc03b 100644
--- a/ash/display/screen_ash.cc
+++ b/ash/display/screen_ash.cc
@@ -30,7 +30,7 @@
display::Screen* screen_for_shutdown = nullptr;
display::DisplayManager* GetDisplayManager() {
- return Shell::GetInstance()->display_manager();
+ return Shell::Get()->display_manager();
}
class ScreenForShutdown : public display::Screen {
diff --git a/ash/display/screen_orientation_controller_chromeos.cc b/ash/display/screen_orientation_controller_chromeos.cc
index c0ef3d6..358ac4f 100644
--- a/ash/display/screen_orientation_controller_chromeos.cc
+++ b/ash/display/screen_orientation_controller_chromeos.cc
@@ -160,14 +160,14 @@
rotation_locked_orientation_(blink::WebScreenOrientationLockAny),
user_rotation_(display::Display::ROTATE_0),
current_rotation_(display::Display::ROTATE_0) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
ScreenOrientationController::~ScreenOrientationController() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
chromeos::AccelerometerReader::GetInstance()->RemoveObserver(this);
WmShell::Get()->RemoveDisplayObserver(this);
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
for (auto& windows : lock_info_map_)
windows.first->aura_window()->RemoveObserver(this);
}
@@ -185,7 +185,7 @@
blink::WebScreenOrientationLockType lock_orientation,
LockCompletionBehavior lock_completion_behavior) {
if (lock_info_map_.empty())
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
if (!requesting_window->aura_window()->HasObserver(this))
requesting_window->aura_window()->AddObserver(this);
@@ -198,7 +198,7 @@
void ScreenOrientationController::UnlockOrientationForWindow(WmWindow* window) {
lock_info_map_.erase(window);
if (lock_info_map_.empty())
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
window->aura_window()->RemoveObserver(this);
ApplyLockForActiveWindow();
}
@@ -207,7 +207,7 @@
for (auto pair : lock_info_map_)
pair.first->aura_window()->RemoveObserver(this);
lock_info_map_.clear();
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
SetRotationLockedInternal(false);
if (user_rotation_ != current_rotation_)
SetDisplayRotation(user_rotation_, display::Display::ROTATION_SOURCE_USER);
@@ -346,7 +346,7 @@
base::AutoReset<bool> auto_ignore_display_configuration_updates(
&ignore_display_configuration_updates_, true);
- Shell::GetInstance()->display_configuration_controller()->SetDisplayRotation(
+ Shell::Get()->display_configuration_controller()->SetDisplayRotation(
display::Display::InternalDisplayId(), rotation, source);
}
@@ -364,7 +364,7 @@
user_locked_orientation_ = orientation;
base::AutoReset<bool> auto_ignore_display_configuration_updates(
&ignore_display_configuration_updates_, true);
- Shell::GetInstance()->display_manager()->RegisterDisplayRotationProperties(
+ Shell::Get()->display_manager()->RegisterDisplayRotationProperties(
user_rotation_locked(), OrientationToRotation(user_locked_orientation_));
ApplyLockForActiveWindow();
@@ -515,8 +515,7 @@
}
void ScreenOrientationController::LoadDisplayRotationProperties() {
- display::DisplayManager* display_manager =
- Shell::GetInstance()->display_manager();
+ display::DisplayManager* display_manager = Shell::Get()->display_manager();
if (!display_manager->registered_internal_display_rotation_lock())
return;
user_locked_orientation_ = RotationToOrientation(
@@ -525,7 +524,7 @@
void ScreenOrientationController::ApplyLockForActiveWindow() {
MruWindowTracker::WindowList mru_windows(
- Shell::GetInstance()->mru_window_tracker()->BuildMruWindowList());
+ Shell::Get()->mru_window_tracker()->BuildMruWindowList());
for (WmWindow* window : mru_windows) {
if (!window->GetTargetVisibility())
diff --git a/ash/display/screen_position_controller_unittest.cc b/ash/display/screen_position_controller_unittest.cc
index 96605ab..3c9135c 100644
--- a/ash/display/screen_position_controller_unittest.cc
+++ b/ash/display/screen_position_controller_unittest.cc
@@ -48,7 +48,7 @@
namespace {
ScreenPositionController* GetScreenPositionController() {
- ShellTestApi test_api(Shell::GetInstance());
+ ShellTestApi test_api(Shell::Get());
return test_api.screen_position_controller();
}
@@ -105,8 +105,7 @@
UpdateDisplay("100+100-200x200,100+500-200x200");
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
EXPECT_EQ(
"100,100",
root_windows[0]->GetHost()->GetBoundsInPixels().origin().ToString());
@@ -194,8 +193,7 @@
TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenHiDPI) {
UpdateDisplay("50+50-200x200*2,50+300-300x300");
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
EXPECT_EQ("50,50 200x200",
root_windows[0]->GetHost()->GetBoundsInPixels().ToString());
EXPECT_EQ("50,300 300x300",
@@ -242,8 +240,7 @@
// Move |window_| to the 2nd.
window_->SetBoundsInScreen(gfx::Rect(300, 20, 50, 50),
display_manager()->GetSecondaryDisplay());
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
EXPECT_EQ(root_windows[1], window_->GetRootWindow());
// The point is on the 2nd host. (50,70) on 2n host -
@@ -274,8 +271,7 @@
// Move |window_| to the 2nd.
window_->SetBoundsInScreen(gfx::Rect(300, 20, 50, 50),
display_manager()->GetSecondaryDisplay());
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
EXPECT_EQ(root_windows[1], window_->GetRootWindow());
// The point is on the 2nd host. (50,70) - ro
@@ -341,8 +337,7 @@
EXPECT_TRUE(window_->GetBoundsInScreen().Contains(
aura::Env::GetInstance()->last_mouse_location()));
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
aura::WindowTracker tracker;
tracker.Add(root_windows[1]);
std::unique_ptr<ConvertToScreenEventHandler> event_handler(
diff --git a/ash/display/shutdown_observer_chromeos.cc b/ash/display/shutdown_observer_chromeos.cc
index 145d2f5..a9540e3e 100644
--- a/ash/display/shutdown_observer_chromeos.cc
+++ b/ash/display/shutdown_observer_chromeos.cc
@@ -12,11 +12,11 @@
ShutdownObserver::ShutdownObserver(
display::DisplayConfigurator* display_configurator)
: display_configurator_(display_configurator) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
ShutdownObserver::~ShutdownObserver() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void ShutdownObserver::OnAppTerminating() {
diff --git a/ash/display/unified_mouse_warp_controller.cc b/ash/display/unified_mouse_warp_controller.cc
index c0adecb..ec347e2 100644
--- a/ash/display/unified_mouse_warp_controller.cc
+++ b/ash/display/unified_mouse_warp_controller.cc
@@ -29,7 +29,7 @@
AshWindowTreeHost* GetMirroringAshWindowTreeHostForDisplayId(
int64_t display_id) {
- return Shell::GetInstance()
+ return Shell::Get()
->window_tree_host_manager()
->mirror_window_controller()
->GetAshWindowTreeHostForDisplayId(display_id);
@@ -41,9 +41,7 @@
aura::WindowTreeHost* FindMirroringWindowTreeHostFromScreenPoint(
const gfx::Point& point_in_screen) {
display::Displays mirroring_display_list =
- Shell::GetInstance()
- ->display_manager()
- ->software_mirroring_display_list();
+ Shell::Get()->display_manager()->software_mirroring_display_list();
auto iter = display::FindDisplayContainingPoint(mirroring_display_list,
point_in_screen);
if (iter == mirroring_display_list.end())
@@ -79,9 +77,7 @@
aura::client::GetCursorClient(target->GetRootWindow());
if (cursor_client) {
display::Displays mirroring_display_list =
- Shell::GetInstance()
- ->display_manager()
- ->software_mirroring_display_list();
+ Shell::Get()->display_manager()->software_mirroring_display_list();
auto iter = display::FindDisplayContainingPoint(mirroring_display_list,
point_in_unified_host);
if (iter != mirroring_display_list.end() &&
@@ -121,9 +117,8 @@
}
void UnifiedMouseWarpController::ComputeBounds() {
- display::Displays display_list = Shell::GetInstance()
- ->display_manager()
- ->software_mirroring_display_list();
+ display::Displays display_list =
+ Shell::Get()->display_manager()->software_mirroring_display_list();
if (display_list.size() < 2) {
LOG(ERROR) << "Mirroring Display lost during re-configuration";
@@ -155,9 +150,8 @@
bool in_second_edge = second_edge_bounds_in_native_.Contains(point_in_native);
if (!in_first_edge && !in_second_edge)
return false;
- display::Displays display_list = Shell::GetInstance()
- ->display_manager()
- ->software_mirroring_display_list();
+ display::Displays display_list =
+ Shell::Get()->display_manager()->software_mirroring_display_list();
// Wait updating the cursor until the cursor moves to the new display
// to avoid showing the wrong sized cursor at the source display.
current_cursor_display_id_ =
diff --git a/ash/display/unified_mouse_warp_controller_unittest.cc b/ash/display/unified_mouse_warp_controller_unittest.cc
index ba35fe0..956b9b1 100644
--- a/ash/display/unified_mouse_warp_controller_unittest.cc
+++ b/ash/display/unified_mouse_warp_controller_unittest.cc
@@ -49,7 +49,7 @@
*point_in_mirroring_host = *point_in_unified_host;
// Convert from mirroring host to unified host.
AshWindowTreeHost* ash_host =
- Shell::GetInstance()
+ Shell::Get()
->window_tree_host_manager()
->mirror_window_controller()
->GetAshWindowTreeHostForDisplayId(info.id());
@@ -62,9 +62,7 @@
bool TestIfMouseWarpsAt(const gfx::Point& point_in_native) {
static_cast<UnifiedMouseWarpController*>(
- Shell::GetInstance()
- ->mouse_cursor_filter()
- ->mouse_warp_controller_for_test())
+ Shell::Get()->mouse_cursor_filter()->mouse_warp_controller_for_test())
->update_location_for_test();
int64_t orig_mirroring_display_id;
gfx::Point point_in_unified_host;
@@ -97,7 +95,7 @@
}
MouseCursorEventFilter* event_filter() {
- return Shell::GetInstance()->mouse_cursor_filter();
+ return Shell::Get()->mouse_cursor_filter();
}
UnifiedMouseWarpController* mouse_warp_controller() {
diff --git a/ash/display/window_tree_host_manager.cc b/ash/display/window_tree_host_manager.cc
index 1f6c065..f3e1f8d 100644
--- a/ash/display/window_tree_host_manager.cc
+++ b/ash/display/window_tree_host_manager.cc
@@ -79,7 +79,7 @@
#endif
display::DisplayManager* GetDisplayManager() {
- return Shell::GetInstance()->display_manager();
+ return Shell::Get()->display_manager();
}
void SetDisplayPropertiesOnHost(AshWindowTreeHost* ash_host,
@@ -247,7 +247,7 @@
void WindowTreeHostManager::Start() {
display::Screen::GetScreen()->AddObserver(this);
- Shell::GetInstance()->display_manager()->set_delegate(this);
+ Shell::Get()->display_manager()->set_delegate(this);
}
void WindowTreeHostManager::Shutdown() {
@@ -256,7 +256,7 @@
// Unset the display manager's delegate here because
// DisplayManager outlives WindowTreeHostManager.
- Shell::GetInstance()->display_manager()->set_delegate(nullptr);
+ Shell::Get()->display_manager()->set_delegate(nullptr);
cursor_window_controller_.reset();
mirror_window_controller_.reset();
@@ -524,7 +524,7 @@
// The cursor's native position did not change but its screen position did
// change. This occurs when the scale factor or the rotation of the display
// that the cursor is on changes.
- Shell::GetInstance()->cursor_manager()->SetDisplay(target_display);
+ Shell::Get()->cursor_manager()->SetDisplay(target_display);
// Update the cursor's root location. This ends up dispatching a synthetic
// mouse move. The synthetic mouse move updates the composited cursor's
@@ -564,9 +564,9 @@
// Magnifier controllers keep pointers to the current root window.
// Update them here to avoid accessing them later.
- Shell::GetInstance()->magnification_controller()->SwitchTargetRootWindow(
+ Shell::Get()->magnification_controller()->SwitchTargetRootWindow(
ash_host->AsWindowTreeHost()->window(), false);
- Shell::GetInstance()
+ Shell::Get()
->partial_magnification_controller()
->SwitchTargetRootWindowIfNeeded(
ash_host->AsWindowTreeHost()->window());
@@ -579,8 +579,7 @@
ash::SystemTray* old_tray =
GetRootWindowController(to_delete->AsWindowTreeHost()->window())
->GetSystemTray();
- ash::SystemTray* new_tray =
- ash::Shell::GetInstance()->GetPrimarySystemTray();
+ ash::SystemTray* new_tray = ash::Shell::Get()->GetPrimarySystemTray();
if (old_tray->GetWidget()->IsVisible()) {
new_tray->SetVisible(true);
new_tray->GetWidget()->Show();
@@ -789,7 +788,7 @@
}
display::DisplayConfigurator* WindowTreeHostManager::display_configurator() {
- return Shell::GetInstance()->display_configurator();
+ return Shell::Get()->display_configurator();
}
ui::EventDispatchDetails WindowTreeHostManager::DispatchKeyEventPostIME(
diff --git a/ash/display/window_tree_host_manager_unittest.cc b/ash/display/window_tree_host_manager_unittest.cc
index 2f1a3bc..c7a5f90 100644
--- a/ash/display/window_tree_host_manager_unittest.cc
+++ b/ash/display/window_tree_host_manager_unittest.cc
@@ -77,7 +77,7 @@
changed_display_id_(0),
focus_changed_count_(0),
activation_changed_count_(0) {
- Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ Shell::Get()->window_tree_host_manager()->AddObserver(this);
display::Screen::GetScreen()->AddObserver(this);
aura::client::GetFocusClient(Shell::GetPrimaryRootWindow())
->AddObserver(this);
@@ -86,7 +86,7 @@
}
~TestObserver() override {
- Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
+ Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
display::Screen::GetScreen()->RemoveObserver(this);
aura::client::GetFocusClient(Shell::GetPrimaryRootWindow())
->RemoveObserver(this);
@@ -262,7 +262,7 @@
// ash::ShellSelegate:
void PreInit() override {
- Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ Shell::Get()->window_tree_host_manager()->AddObserver(this);
}
// ash::WindowTreeHostManager::Observer:
@@ -292,8 +292,7 @@
test::AshTestBase::SetUp();
}
void TearDown() override {
- Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(
- startup_helper_);
+ Shell::Get()->window_tree_host_manager()->RemoveObserver(startup_helper_);
test::AshTestBase::TearDown();
}
@@ -710,8 +709,7 @@
// avoid getting the OnDisplayConfigurationChanged() call twice in
// SetDisplayUIScale. Note that this scenario will never happen on
// real devices.
- Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId(
- secondary_id);
+ Shell::Get()->window_tree_host_manager()->SetPrimaryDisplayId(secondary_id);
EXPECT_EQ(1, observer.CountAndReset());
display::test::DisplayManagerTestApi(display_manager())
@@ -738,7 +736,7 @@
TEST_F(WindowTreeHostManagerTest, FindNearestDisplay) {
WindowTreeHostManager* window_tree_host_manager =
- Shell::GetInstance()->window_tree_host_manager();
+ Shell::Get()->window_tree_host_manager();
UpdateDisplay("200x200,300x300");
display_manager()->SetLayoutForCurrentDisplays(
@@ -797,7 +795,7 @@
TEST_F(WindowTreeHostManagerTest, SwapPrimaryById) {
WindowTreeHostManager* window_tree_host_manager =
- Shell::GetInstance()->window_tree_host_manager();
+ Shell::Get()->window_tree_host_manager();
UpdateDisplay("200x200,300x300");
display::Display primary_display =
@@ -973,7 +971,7 @@
EXPECT_EQ(primary_id, display::Screen::GetScreen()->GetPrimaryDisplay().id());
WindowTreeHostManager* window_tree_host_manager =
- Shell::GetInstance()->window_tree_host_manager();
+ Shell::Get()->window_tree_host_manager();
aura::Window* primary_root =
window_tree_host_manager->GetRootWindowForDisplayId(primary_id);
@@ -1095,7 +1093,7 @@
EXPECT_EQ(primary_id, display::Screen::GetScreen()->GetPrimaryDisplay().id());
WindowTreeHostManager* window_tree_host_manager =
- Shell::GetInstance()->window_tree_host_manager();
+ Shell::Get()->window_tree_host_manager();
// Make non_primary_ids[2] primary.
window_tree_host_manager->SetPrimaryDisplayId(non_primary_ids[2]);
@@ -1174,9 +1172,9 @@
TEST_F(WindowTreeHostManagerTest, OverscanInsets) {
WindowTreeHostManager* window_tree_host_manager =
- Shell::GetInstance()->window_tree_host_manager();
+ Shell::Get()->window_tree_host_manager();
TestEventHandler event_handler;
- Shell::GetInstance()->AddPreTargetHandler(&event_handler);
+ Shell::Get()->AddPreTargetHandler(&event_handler);
UpdateDisplay("120x200,300x400*2");
display::Display display1 = display::Screen::GetScreen()->GetPrimaryDisplay();
@@ -1216,12 +1214,12 @@
&point);
EXPECT_EQ("15,10", point.ToString());
- Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ Shell::Get()->RemovePreTargetHandler(&event_handler);
}
TEST_F(WindowTreeHostManagerTest, Rotate) {
TestEventHandler event_handler;
- Shell::GetInstance()->AddPreTargetHandler(&event_handler);
+ Shell::Get()->AddPreTargetHandler(&event_handler);
UpdateDisplay("120x200,300x400*2");
display::Display display1 = display::Screen::GetScreen()->GetPrimaryDisplay();
@@ -1295,12 +1293,12 @@
generator1.MoveMouseToInHost(50, 40);
EXPECT_EQ("69,159", event_handler.GetLocationAndReset());
- Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ Shell::Get()->RemovePreTargetHandler(&event_handler);
}
TEST_F(WindowTreeHostManagerTest, ScaleRootWindow) {
TestEventHandler event_handler;
- Shell::GetInstance()->AddPreTargetHandler(&event_handler);
+ Shell::Get()->AddPreTargetHandler(&event_handler);
UpdateDisplay("600x400*[email protected],500x300");
@@ -1330,12 +1328,12 @@
EXPECT_EQ(1.25f, GetStoredUIScale(display1.id()));
EXPECT_EQ(1.0f, GetStoredUIScale(display2.id()));
- Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ Shell::Get()->RemovePreTargetHandler(&event_handler);
}
TEST_F(WindowTreeHostManagerTest, TouchScale) {
TestEventHandler event_handler;
- Shell::GetInstance()->AddPreTargetHandler(&event_handler);
+ Shell::Get()->AddPreTargetHandler(&event_handler);
UpdateDisplay("200x200*2");
display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
@@ -1359,12 +1357,12 @@
EXPECT_EQ(event_handler.scroll_y_offset(),
event_handler.scroll_y_offset_ordinal());
- Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ Shell::Get()->RemovePreTargetHandler(&event_handler);
}
TEST_F(WindowTreeHostManagerTest, ConvertHostToRootCoords) {
TestEventHandler event_handler;
- Shell::GetInstance()->AddPreTargetHandler(&event_handler);
+ Shell::Get()->AddPreTargetHandler(&event_handler);
UpdateDisplay("600x400*2/[email protected]");
@@ -1416,7 +1414,7 @@
generator.MoveMouseToInHost(0, 399);
EXPECT_EQ("0,0", event_handler.GetLocationAndReset());
- Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ Shell::Get()->RemovePreTargetHandler(&event_handler);
}
// Make sure that the compositor based mirroring can switch
@@ -1632,7 +1630,7 @@
UpdateDisplay("200x200,200x200*2/r");
aura::Env* env = aura::Env::GetInstance();
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
WindowTreeHostManager* window_tree_host_manager =
shell->window_tree_host_manager();
test::CursorManagerTestApi test_api(shell->cursor_manager());
@@ -1656,7 +1654,7 @@
TEST_F(WindowTreeHostManagerTest,
UpdateMouseLocationAfterDisplayChange_PrimaryDisconnected) {
aura::Env* env = aura::Env::GetInstance();
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
WindowTreeHostManager* window_tree_host_manager =
shell->window_tree_host_manager();
test::CursorManagerTestApi test_api(shell->cursor_manager());
@@ -1689,10 +1687,9 @@
TEST_F(WindowTreeHostManagerTest,
GetRootWindowForDisplayIdDuringDisplayDisconnection) {
UpdateDisplay("300x300,200x200");
- aura::Window* root2 = Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(
- display_manager()->GetSecondaryDisplay().id());
+ aura::Window* root2 =
+ Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display_manager()->GetSecondaryDisplay().id());
views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds(
nullptr, root2, gfx::Rect(350, 0, 100, 100));
views::View* view = new views::View();
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index 1d07181..cc41feef 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -135,13 +135,13 @@
drag_drop_window_delegate_(new DragDropTrackerDelegate(this)),
current_drag_event_source_(ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE),
weak_factory_(this) {
- Shell::GetInstance()->PrependPreTargetHandler(this);
+ Shell::Get()->PrependPreTargetHandler(this);
WmShell::Get()->AddDisplayObserver(this);
}
DragDropController::~DragDropController() {
WmShell::Get()->RemoveDisplayObserver(this);
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
Cleanup();
if (cancel_animation_)
cancel_animation_->End();
@@ -442,7 +442,7 @@
cursor = ui::kCursorAlias;
else if (op & ui::DragDropTypes::DRAG_MOVE)
cursor = ui::kCursorGrabbing;
- ash::Shell::GetInstance()->cursor_manager()->SetCursor(cursor);
+ ash::Shell::Get()->cursor_manager()->SetCursor(cursor);
}
}
@@ -459,7 +459,7 @@
void DragDropController::Drop(aura::Window* target,
const ui::LocatedEvent& event) {
- ash::Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorPointer);
+ ash::Shell::Get()->cursor_manager()->SetCursor(ui::kCursorPointer);
// We must guarantee that a target gets a OnDragEntered before Drop. WebKit
// depends on not getting a Drop without DragEnter. This behavior is
@@ -514,7 +514,7 @@
}
void DragDropController::DoDragCancel(int drag_cancel_animation_duration_ms) {
- ash::Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorPointer);
+ ash::Shell::Get()->cursor_manager()->SetCursor(ui::kCursorPointer);
// |drag_window_| can be NULL if we have just started the drag and have not
// received any DragUpdates, or, if the |drag_window_| gets destroyed during
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc
index 47b719f..9896a38 100644
--- a/ash/drag_drop/drag_drop_controller_unittest.cc
+++ b/ash/drag_drop/drag_drop_controller_unittest.cc
@@ -936,8 +936,7 @@
// across displays when drag is cancelled.
TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) {
UpdateDisplay("400x400,400x400");
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
for (aura::Window::Windows::iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter) {
aura::client::SetDragDropClient(*iter, drag_drop_controller_.get());
@@ -1014,7 +1013,7 @@
// Verifies that a drag is aborted if a display is disconnected during the drag.
TEST_F(DragDropControllerTest, DragCancelOnDisplayDisconnect) {
UpdateDisplay("400x400,400x400");
- for (aura::Window* root : Shell::GetInstance()->GetAllRootWindows()) {
+ for (aura::Window* root : Shell::Get()->GetAllRootWindows()) {
aura::client::SetDragDropClient(root, drag_drop_controller_.get());
}
diff --git a/ash/drag_drop/drag_drop_interactive_uitest.cc b/ash/drag_drop/drag_drop_interactive_uitest.cc
index 4c0e0d0..dacca73 100644
--- a/ash/drag_drop/drag_drop_interactive_uitest.cc
+++ b/ash/drag_drop/drag_drop_interactive_uitest.cc
@@ -117,8 +117,7 @@
// during drag & drop operation.
TEST_F(DragDropTest, DragDropAcrossMultiDisplay) {
UpdateDisplay("400x400,400x400");
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
views::View* draggable_view = new DraggableView();
draggable_view->set_drag_controller(NULL);
draggable_view->SetBounds(0, 0, 100, 100);
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc
index a0f2c50..444f39b 100644
--- a/ash/extended_desktop_unittest.cc
+++ b/ash/extended_desktop_unittest.cc
@@ -36,9 +36,9 @@
void SetSecondaryDisplayLayout(display::DisplayPlacement::Position position) {
std::unique_ptr<display::DisplayLayout> layout =
- Shell::GetInstance()->display_manager()->GetCurrentDisplayLayout().Copy();
+ Shell::Get()->display_manager()->GetCurrentDisplayLayout().Copy();
layout->placement_list[0].position = position;
- Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
+ Shell::Get()->display_manager()->SetLayoutForCurrentDisplays(
std::move(layout));
}
@@ -258,7 +258,7 @@
aura::WindowTreeHost* host1 = root_windows[1]->GetHost();
EXPECT_EQ(ui::kCursorPointer, host0->last_cursor().native_type());
EXPECT_EQ(ui::kCursorNull, host1->last_cursor().native_type());
- Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorCopy);
+ Shell::Get()->cursor_manager()->SetCursor(ui::kCursorCopy);
EXPECT_EQ(ui::kCursorCopy, host0->last_cursor().native_type());
EXPECT_EQ(ui::kCursorCopy, host1->last_cursor().native_type());
}
@@ -697,7 +697,7 @@
TEST_F(ExtendedDesktopTest, OpenSystemTray) {
UpdateDisplay("500x600,600x400");
- SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
+ SystemTray* tray = ash::Shell::Get()->GetPrimarySystemTray();
ASSERT_FALSE(tray->HasSystemBubble());
ui::test::EventGenerator& event_generator(GetEventGenerator());
@@ -833,7 +833,7 @@
TEST_F(ExtendedDesktopTest, PassiveGrab) {
EventLocationRecordingEventHandler event_handler;
- ash::Shell::GetInstance()->AddPreTargetHandler(&event_handler);
+ ash::Shell::Get()->AddPreTargetHandler(&event_handler);
UpdateDisplay("300x300,200x200");
@@ -856,7 +856,7 @@
generator.MoveMouseTo(400, 150);
EXPECT_EQ("100,150 100,150", event_handler.GetLocationsAndReset());
- ash::Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
+ ash::Shell::Get()->RemovePreTargetHandler(&event_handler);
}
} // namespace ash
diff --git a/ash/first_run/desktop_cleaner.cc b/ash/first_run/desktop_cleaner.cc
index 48b630a..a170489 100644
--- a/ash/first_run/desktop_cleaner.cc
+++ b/ash/first_run/desktop_cleaner.cc
@@ -92,7 +92,7 @@
DesktopCleaner::DesktopCleaner() {
// TODO(dzhioev): Add support for secondary displays.
- aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::Get()->GetPrimaryRootWindow();
for (size_t i = 0; i < arraysize(kContainerIdsToHide); ++i) {
aura::Window* container =
Shell::GetContainer(root_window, kContainerIdsToHide[i]);
diff --git a/ash/first_run/first_run_helper_impl.cc b/ash/first_run/first_run_helper_impl.cc
index 321351c7..325d474 100644
--- a/ash/first_run/first_run_helper_impl.cc
+++ b/ash/first_run/first_run_helper_impl.cc
@@ -41,11 +41,11 @@
} // anonymous namespace
FirstRunHelperImpl::FirstRunHelperImpl() : widget_(CreateFirstRunWindow()) {
- Shell::GetInstance()->overlay_filter()->Activate(this);
+ Shell::Get()->overlay_filter()->Activate(this);
}
FirstRunHelperImpl::~FirstRunHelperImpl() {
- Shell::GetInstance()->overlay_filter()->Deactivate(this);
+ Shell::Get()->overlay_filter()->Deactivate(this);
if (IsTrayBubbleOpened())
CloseTrayBubble();
widget_->Close();
@@ -75,29 +75,29 @@
}
void FirstRunHelperImpl::OpenTrayBubble() {
- SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray();
+ SystemTray* tray = Shell::Get()->GetPrimarySystemTray();
tray->ShowPersistentDefaultView();
}
void FirstRunHelperImpl::CloseTrayBubble() {
- SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray();
+ SystemTray* tray = Shell::Get()->GetPrimarySystemTray();
DCHECK(tray->HasSystemBubble()) << "Tray bubble is closed already.";
tray->CloseSystemBubble();
}
bool FirstRunHelperImpl::IsTrayBubbleOpened() {
- SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray();
+ SystemTray* tray = Shell::Get()->GetPrimarySystemTray();
return tray->HasSystemBubble();
}
gfx::Rect FirstRunHelperImpl::GetTrayBubbleBounds() {
- SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray();
+ SystemTray* tray = Shell::Get()->GetPrimarySystemTray();
views::View* bubble = tray->GetSystemBubble()->bubble_view();
return bubble->GetBoundsInScreen();
}
gfx::Rect FirstRunHelperImpl::GetHelpButtonBounds() {
- SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray();
+ SystemTray* tray = Shell::Get()->GetPrimarySystemTray();
views::View* help_button = tray->GetHelpButtonView();
return help_button->GetBoundsInScreen();
}
diff --git a/ash/first_run/first_run_helper_unittest.cc b/ash/first_run/first_run_helper_unittest.cc
index 20b70fc..feca789 100644
--- a/ash/first_run/first_run_helper_unittest.cc
+++ b/ash/first_run/first_run_helper_unittest.cc
@@ -63,7 +63,7 @@
void SetUp() override {
AshTestBase::SetUp();
CheckContainersAreVisible();
- helper_.reset(ash::Shell::GetInstance()->CreateFirstRunHelper());
+ helper_.reset(ash::Shell::Get()->CreateFirstRunHelper());
helper_->AddObserver(this);
helper_->GetOverlayWidget()->Show();
}
@@ -76,7 +76,7 @@
}
void CheckContainersAreVisible() const {
- aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::Get()->GetPrimaryRootWindow();
std::vector<int> containers_to_check =
DesktopCleaner::GetContainersToHideForTest();
for (size_t i = 0; i < containers_to_check.size(); ++i) {
@@ -87,7 +87,7 @@
}
void CheckContainersAreHidden() const {
- aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::Get()->GetPrimaryRootWindow();
std::vector<int> containers_to_check =
DesktopCleaner::GetContainersToHideForTest();
for (size_t i = 0; i < containers_to_check.size(); ++i) {
diff --git a/ash/high_contrast/high_contrast_controller.cc b/ash/high_contrast/high_contrast_controller.cc
index 0cb98a5..ea3c8e5 100644
--- a/ash/high_contrast/high_contrast_controller.cc
+++ b/ash/high_contrast/high_contrast_controller.cc
@@ -12,11 +12,11 @@
namespace ash {
HighContrastController::HighContrastController() : enabled_(false) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
HighContrastController::~HighContrastController() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void HighContrastController::SetEnabled(bool enabled) {
diff --git a/ash/laser/laser_pointer_controller.cc b/ash/laser/laser_pointer_controller.cc
index 390d97148..f23fe1f 100644
--- a/ash/laser/laser_pointer_controller.cc
+++ b/ash/laser/laser_pointer_controller.cc
@@ -44,7 +44,7 @@
base::Bind(&LaserPointerController::AddStationaryPoint,
base::Unretained(this)),
true /* is_repeating */)) {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
int64_t presentation_delay_ms;
// Use device specific presentation delay if specified.
@@ -58,7 +58,7 @@
}
LaserPointerController::~LaserPointerController() {
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
void LaserPointerController::SetEnabled(bool enabled) {
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc
index a26f7d2a..76915e5 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -277,7 +277,7 @@
scale_(kNonMagnifiedScale),
scroll_direction_(SCROLL_NONE),
disable_move_magnifier_delay_(false) {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
root_window_->AddObserver(this);
point_of_interest_ = root_window_->bounds().CenterPoint();
}
@@ -289,7 +289,7 @@
root_window_->RemoveObserver(this);
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
void MagnificationControllerImpl::RedrawKeepingMousePosition(float scale,
@@ -565,8 +565,7 @@
return;
ValidateScale(&scale);
- Shell::GetInstance()->accessibility_delegate()->SaveScreenMagnifierScale(
- scale);
+ Shell::Get()->accessibility_delegate()->SaveScreenMagnifierScale(scale);
RedrawKeepingMousePosition(scale, animate);
}
@@ -597,7 +596,7 @@
if (!is_enabled_ && input_method)
input_method->AddObserver(this);
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
float scale =
shell->accessibility_delegate()->GetSavedScreenMagnifierScale();
if (scale <= 0.0f)
diff --git a/ash/magnifier/magnification_controller_unittest.cc b/ash/magnifier/magnification_controller_unittest.cc
index 1dacc27..7c0906f 100644
--- a/ash/magnifier/magnification_controller_unittest.cc
+++ b/ash/magnifier/magnification_controller_unittest.cc
@@ -80,7 +80,7 @@
}
ash::MagnificationController* GetMagnificationController() const {
- return ash::Shell::GetInstance()->magnification_controller();
+ return ash::Shell::Get()->magnification_controller();
}
gfx::Rect GetViewport() const {
@@ -672,7 +672,7 @@
// Make sure that unified desktop can enter magnified mode.
TEST_F(MagnificationControllerTest, EnableMagnifierInUnifiedDesktop) {
- Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true);
+ Shell::Get()->display_manager()->SetUnifiedDesktopEnabled(true);
EXPECT_EQ(1.0f, GetMagnificationController()->GetScale());
diff --git a/ash/magnifier/partial_magnification_controller.cc b/ash/magnifier/partial_magnification_controller.cc
index fd9e04e..89c6130 100644
--- a/ash/magnifier/partial_magnification_controller.cc
+++ b/ash/magnifier/partial_magnification_controller.cc
@@ -206,13 +206,13 @@
};
PartialMagnificationController::PartialMagnificationController() {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
}
PartialMagnificationController::~PartialMagnificationController() {
CloseMagnifierWindow();
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
void PartialMagnificationController::SetEnabled(bool enabled) {
diff --git a/ash/magnifier/partial_magnification_controller_unittest.cc b/ash/magnifier/partial_magnification_controller_unittest.cc
index 1c8e4b5bc..b58ccf4 100644
--- a/ash/magnifier/partial_magnification_controller_unittest.cc
+++ b/ash/magnifier/partial_magnification_controller_unittest.cc
@@ -42,17 +42,17 @@
void SetUp() override {
AshTestBase::SetUp();
- Shell::GetInstance()->display_manager()->UpdateDisplays();
+ Shell::Get()->display_manager()->UpdateDisplays();
}
protected:
PartialMagnificationController* GetController() const {
- return Shell::GetInstance()->partial_magnification_controller();
+ return Shell::Get()->partial_magnification_controller();
}
PartialMagnificationControllerTestApi GetTestApi() const {
return PartialMagnificationControllerTestApi(
- Shell::GetInstance()->partial_magnification_controller());
+ Shell::Get()->partial_magnification_controller());
}
private:
diff --git a/ash/metrics/desktop_task_switch_metric_recorder.cc b/ash/metrics/desktop_task_switch_metric_recorder.cc
index 2c0a9cc..133e299a 100644
--- a/ash/metrics/desktop_task_switch_metric_recorder.cc
+++ b/ash/metrics/desktop_task_switch_metric_recorder.cc
@@ -13,11 +13,11 @@
DesktopTaskSwitchMetricRecorder::DesktopTaskSwitchMetricRecorder()
: last_active_task_window_(nullptr) {
- Shell::GetInstance()->activation_client()->AddObserver(this);
+ Shell::Get()->activation_client()->AddObserver(this);
}
DesktopTaskSwitchMetricRecorder::~DesktopTaskSwitchMetricRecorder() {
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ Shell::Get()->activation_client()->RemoveObserver(this);
}
void DesktopTaskSwitchMetricRecorder::OnWindowActivated(
diff --git a/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc b/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc
index 2dcf49f..2af3877 100644
--- a/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc
+++ b/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc
@@ -26,8 +26,8 @@
// Test fixture for the DesktopTaskSwitchMetricsRecorder class. NOTE: This
// fixture extends AshTestBase so that the UserMetricsRecorder instance required
-// by the test target can be obtained through Shell::GetInstance()->metrics()
-// and the test target is not the same instance as the one owned by the
+// by the test target can be obtained through Shell::Get()->metrics() and the
+// test target is not the same instance as the one owned by the
// UserMetricsRecorder instance.
class DesktopTaskSwitchMetricRecorderTest : public test::AshTestBase {
public:
@@ -341,8 +341,7 @@
aura::Window* positionable_window =
CreatePositionableWindowInShellWithBounds(gfx::Rect(0, 0, 10, 10));
- Shell::GetInstance()->activation_client()->ActivateWindow(
- positionable_window);
+ Shell::Get()->activation_client()->ActivateWindow(positionable_window);
EXPECT_EQ(0, GetActionCount());
}
diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc
index 97434bd..7ca11171 100644
--- a/ash/metrics/user_metrics_recorder.cc
+++ b/ash/metrics/user_metrics_recorder.cc
@@ -130,7 +130,7 @@
break;
const aura::Window::Windows& children =
- Shell::GetContainer(Shell::GetInstance()->GetPrimaryRootWindow(),
+ Shell::GetContainer(Shell::Get()->GetPrimaryRootWindow(),
current_container_id)
->children();
// Reverse iterate over the child windows so that they are processed in
@@ -606,7 +606,7 @@
void UserMetricsRecorder::OnShellInitialized() {
// Lazy creation of the DesktopTaskSwitchMetricRecorder because it accesses
- // Shell::GetInstance() which is not available when |this| is instantiated.
+ // Shell::Get() which is not available when |this| is instantiated.
if (!desktop_task_switch_metric_recorder_) {
desktop_task_switch_metric_recorder_.reset(
new DesktopTaskSwitchMetricRecorder());
diff --git a/ash/mus/bridge/wm_shell_mus.cc b/ash/mus/bridge/wm_shell_mus.cc
index 726201c..3375fec 100644
--- a/ash/mus/bridge/wm_shell_mus.cc
+++ b/ash/mus/bridge/wm_shell_mus.cc
@@ -250,7 +250,7 @@
void WmShellMus::RecordUserMetricsAction(UserMetricsAction action) {
if (GetAshConfig() == Config::MUS) {
- Shell::GetInstance()->metrics()->RecordUserMetricsAction(action);
+ Shell::Get()->metrics()->RecordUserMetricsAction(action);
return;
}
// TODO: http://crbug.com/616581.
@@ -259,10 +259,8 @@
void WmShellMus::RecordTaskSwitchMetric(TaskSwitchSource source) {
if (GetAshConfig() == Config::MUS) {
- Shell::GetInstance()
- ->metrics()
- ->task_switch_metrics_recorder()
- .OnTaskSwitch(source);
+ Shell::Get()->metrics()->task_switch_metrics_recorder().OnTaskSwitch(
+ source);
return;
}
// TODO: http://crbug.com/616581.
@@ -349,9 +347,8 @@
}
SessionStateDelegate* WmShellMus::GetSessionStateDelegate() {
- return session_state_delegate_
- ? session_state_delegate_.get()
- : Shell::GetInstance()->session_state_delegate();
+ return session_state_delegate_ ? session_state_delegate_.get()
+ : Shell::Get()->session_state_delegate();
}
void WmShellMus::AddDisplayObserver(WmDisplayObserver* observer) {
@@ -397,9 +394,7 @@
void WmShellMus::ToggleIgnoreExternalKeyboard() {
if (GetAshConfig() == Config::MUS) {
- Shell::GetInstance()
- ->virtual_keyboard_controller()
- ->ToggleIgnoreExternalKeyboard();
+ Shell::Get()->virtual_keyboard_controller()->ToggleIgnoreExternalKeyboard();
return;
}
@@ -408,7 +403,7 @@
void WmShellMus::SetLaserPointerEnabled(bool enabled) {
if (GetAshConfig() == Config::MUS) {
- Shell::GetInstance()->laser_pointer_controller()->SetEnabled(enabled);
+ Shell::Get()->laser_pointer_controller()->SetEnabled(enabled);
return;
}
@@ -417,8 +412,7 @@
void WmShellMus::SetPartialMagnifierEnabled(bool enabled) {
if (GetAshConfig() == Config::MUS) {
- Shell::GetInstance()->partial_magnification_controller()->SetEnabled(
- enabled);
+ Shell::Get()->partial_magnification_controller()->SetEnabled(enabled);
return;
}
diff --git a/ash/mus/context_menu_mus.cc b/ash/mus/context_menu_mus.cc
index b012596..3962e78 100644
--- a/ash/mus/context_menu_mus.cc
+++ b/ash/mus/context_menu_mus.cc
@@ -47,7 +47,7 @@
? SHELF_AUTO_HIDE_BEHAVIOR_NEVER
: SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
} else if (command_id == MENU_CHANGE_WALLPAPER) {
- Shell::GetInstance()->wallpaper_controller()->OpenSetWallpaperPage();
+ Shell::Get()->wallpaper_controller()->OpenSetWallpaperPage();
}
}
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index 1eba1abe..d05ea5d 100644
--- a/ash/mus/window_manager.cc
+++ b/ash/mus/window_manager.cc
@@ -560,11 +560,11 @@
}
bool WindowManager::IsWindowActive(aura::Window* window) {
- return Shell::GetInstance()->activation_client()->GetActiveWindow() == window;
+ return Shell::Get()->activation_client()->GetActiveWindow() == window;
}
void WindowManager::OnWmDeactivateWindow(aura::Window* window) {
- Shell::GetInstance()->activation_client()->DeactivateWindow(window);
+ Shell::Get()->activation_client()->DeactivateWindow(window);
}
} // namespace mus
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 6ba028a..d3f4f493 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -375,8 +375,7 @@
// Notify shell observers that the shelf has been created.
// TODO(jamescook): Move this into WmShelf::InitializeShelf(). This will
// require changing AttachedPanelWidgetTargeter's access to WmShelf.
- Shell::GetInstance()->NotifyShelfCreatedForRootWindow(
- WmWindow::Get(GetRootWindow()));
+ Shell::Get()->NotifyShelfCreatedForRootWindow(WmWindow::Get(GetRootWindow()));
wm_shelf_->shelf_widget()->PostCreateShelf();
}
@@ -540,7 +539,7 @@
}
void RootWindowController::Shutdown() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
touch_exploration_manager_.reset();
@@ -633,7 +632,7 @@
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kAshTouchHud))
set_touch_hud_debug(new TouchHudDebug(GetRootWindow()));
- if (Shell::GetInstance()->is_touch_hud_projection_enabled())
+ if (Shell::Get()->is_touch_hud_projection_enabled())
EnableTouchHudProjection();
}
@@ -649,8 +648,8 @@
return;
}
DCHECK(keyboard_controller);
- Shell::GetInstance()->NotifyVirtualKeyboardActivated(
- true, WmWindow::Get(GetRootWindow()));
+ Shell::Get()->NotifyVirtualKeyboardActivated(true,
+ WmWindow::Get(GetRootWindow()));
aura::Window* parent = GetContainer(kShellWindowId_ImeWindowParentContainer);
DCHECK(parent);
aura::Window* keyboard_container = keyboard_controller->GetContainerWindow();
@@ -674,7 +673,7 @@
keyboard_controller->HideKeyboard(
keyboard::KeyboardController::HIDE_REASON_AUTOMATIC);
parent->RemoveChild(keyboard_container);
- Shell::GetInstance()->NotifyVirtualKeyboardActivated(
+ Shell::Get()->NotifyVirtualKeyboardActivated(
false, WmWindow::Get(GetRootWindow()));
}
}
@@ -752,7 +751,7 @@
void RootWindowController::Init(RootWindowType root_window_type) {
aura::Window* root_window = GetRootWindow();
WmShell* wm_shell = WmShell::Get();
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
shell->InitRootWindow(root_window);
CreateContainers();
@@ -1081,7 +1080,7 @@
// The root window for new windows is being destroyed. Switch to the primary
// root window if possible.
WmWindow* primary_root = WmShell::Get()->GetPrimaryRootWindow();
- Shell::GetInstance()->set_root_window_for_new_windows(
+ Shell::Get()->set_root_window_for_new_windows(
primary_root == root ? nullptr : primary_root);
}
}
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index c6e08ca..fc24224 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -538,7 +538,7 @@
TEST_F(RootWindowControllerTest, MultipleDisplaysGetWindowForFullscreenMode) {
UpdateDisplay("600x600,600x600");
Shell::RootWindowControllerList controllers =
- Shell::GetInstance()->GetAllRootWindowControllers();
+ Shell::Get()->GetAllRootWindowControllers();
Widget* w1 = CreateTestWidget(gfx::Rect(0, 0, 100, 100));
w1->Maximize();
@@ -575,7 +575,7 @@
TEST_F(RootWindowControllerTest, GetRootWindowController) {
UpdateDisplay("600x600,600x600");
Shell::RootWindowControllerList controllers =
- Shell::GetInstance()->GetAllRootWindowControllers();
+ Shell::Get()->GetAllRootWindowControllers();
ASSERT_EQ(2u, controllers.size());
// Test null.
@@ -668,14 +668,14 @@
observer1.SetWindow(window1);
window1->Init(ui::LAYER_NOT_DRAWN);
aura::client::ParentWindowWithContext(
- window1, Shell::GetInstance()->GetPrimaryRootWindow(), gfx::Rect());
+ window1, Shell::Get()->GetPrimaryRootWindow(), gfx::Rect());
DestroyedWindowObserver observer2;
aura::Window* window2 = new aura::Window(NULL);
window2->set_owned_by_parent(false);
observer2.SetWindow(window2);
window2->Init(ui::LAYER_NOT_DRAWN);
- Shell::GetInstance()->GetPrimaryRootWindow()->AddChild(window2);
+ Shell::Get()->GetPrimaryRootWindow()->AddChild(window2);
Shell::GetPrimaryRootWindowController()->CloseChildWindows();
@@ -697,7 +697,7 @@
keyboard::switches::kEnableVirtualKeyboard);
test::AshTestBase::SetUp();
keyboard::SetTouchKeyboardEnabled(true);
- Shell::GetInstance()->CreateKeyboard();
+ Shell::Get()->CreateKeyboard();
}
void TearDown() override {
@@ -768,8 +768,8 @@
UpdateDisplay("500x500,500x500");
display::Display secondary_display =
- Shell::GetInstance()->display_manager()->GetSecondaryDisplay();
- display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
+ Shell::Get()->display_manager()->GetSecondaryDisplay();
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetTouchSupport(secondary_display.id(),
display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE);
@@ -777,11 +777,9 @@
// does.
ASSERT_NE(display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE,
display::Screen::GetScreen()->GetPrimaryDisplay().touch_support());
- ASSERT_EQ(display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE,
- Shell::GetInstance()
- ->display_manager()
- ->GetSecondaryDisplay()
- .touch_support());
+ ASSERT_EQ(
+ display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE,
+ Shell::Get()->display_manager()->GetSecondaryDisplay().touch_support());
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
aura::Window* primary_root_window = Shell::GetPrimaryRootWindow();
@@ -823,23 +821,21 @@
UpdateDisplay("500x500,500x500");
const int64_t primary_display_id =
display::Screen::GetScreen()->GetPrimaryDisplay().id();
- display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetTouchSupport(primary_display_id,
display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE);
const int64_t secondary_display_id =
- Shell::GetInstance()->display_manager()->GetSecondaryDisplay().id();
- display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
+ Shell::Get()->display_manager()->GetSecondaryDisplay().id();
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetTouchSupport(secondary_display_id,
display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE);
// Both of displays have touch capability.
ASSERT_EQ(display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE,
display::Screen::GetScreen()->GetPrimaryDisplay().touch_support());
- ASSERT_EQ(display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE,
- Shell::GetInstance()
- ->display_manager()
- ->GetSecondaryDisplay()
- .touch_support());
+ ASSERT_EQ(
+ display::Display::TouchSupport::TOUCH_SUPPORT_AVAILABLE,
+ Shell::Get()->display_manager()->GetSecondaryDisplay().touch_support());
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
aura::Window* primary_root_window = Shell::GetPrimaryRootWindow();
@@ -968,7 +964,7 @@
aura::WindowTracker tracker;
tracker.Add(keyboard_container);
// Reinitialize the keyboard.
- Shell::GetInstance()->CreateKeyboard();
+ Shell::Get()->CreateKeyboard();
// keyboard_container should no longer be present.
EXPECT_FALSE(tracker.Contains(keyboard_container));
}
diff --git a/ash/rotator/screen_rotation_animator.cc b/ash/rotator/screen_rotation_animator.cc
index 102b8d0..b78ccd15 100644
--- a/ash/rotator/screen_rotation_animator.cc
+++ b/ash/rotator/screen_rotation_animator.cc
@@ -58,14 +58,14 @@
}
display::Display::Rotation GetCurrentScreenRotation(int64_t display_id) {
- return Shell::GetInstance()
+ return Shell::Get()
->display_manager()
->GetDisplayInfo(display_id)
.GetActiveRotation();
}
bool IsDisplayIdValid(int64_t display_id) {
- return Shell::GetInstance()->display_manager()->IsDisplayIdValid(display_id);
+ return Shell::Get()->display_manager()->IsDisplayIdValid(display_id);
}
// 180 degree rotations should animate clock-wise.
@@ -77,9 +77,8 @@
}
aura::Window* GetRootWindow(int64_t display_id) {
- return Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display_id);
+ return Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display_id);
}
// Returns true if the rotation between |initial_rotation| and |new_rotation| is
@@ -242,7 +241,7 @@
std::unique_ptr<LayerCleanupObserver> old_layer_cleanup_observer(
new LayerCleanupObserver(weak_factory_.GetWeakPtr()));
- Shell::GetInstance()->display_manager()->SetDisplayRotation(
+ Shell::Get()->display_manager()->SetDisplayRotation(
display_id_, rotation_request->new_rotation, rotation_request->source);
const gfx::Rect rotated_screen_bounds = root_window->GetTargetBounds();
diff --git a/ash/rotator/screen_rotation_animator_unittest.cc b/ash/rotator/screen_rotation_animator_unittest.cc
index 1b464c6..9a84d05 100644
--- a/ash/rotator/screen_rotation_animator_unittest.cc
+++ b/ash/rotator/screen_rotation_animator_unittest.cc
@@ -19,7 +19,7 @@
namespace {
display::Display::Rotation GetDisplayRotation(int64_t display_id) {
- return Shell::GetInstance()
+ return Shell::Get()
->display_manager()
->GetDisplayInfo(display_id)
.GetActiveRotation();
@@ -27,7 +27,7 @@
void SetDisplayRotation(int64_t display_id,
display::Display::Rotation rotation) {
- Shell::GetInstance()->display_manager()->SetDisplayRotation(
+ Shell::Get()->display_manager()->SetDisplayRotation(
display_id, rotation,
display::Display::RotationSource::ROTATION_SOURCE_USER);
}
diff --git a/ash/shelf/shelf_bezel_event_handler.cc b/ash/shelf/shelf_bezel_event_handler.cc
index da40409..3b62a8b 100644
--- a/ash/shelf/shelf_bezel_event_handler.cc
+++ b/ash/shelf/shelf_bezel_event_handler.cc
@@ -18,11 +18,11 @@
ShelfBezelEventHandler::ShelfBezelEventHandler(WmShelf* shelf)
: shelf_(shelf), in_touch_drag_(false) {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
}
ShelfBezelEventHandler::~ShelfBezelEventHandler() {
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
void ShelfBezelEventHandler::OnGestureEvent(ui::GestureEvent* event) {
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index 5ea85267..3ac49be 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -754,7 +754,7 @@
UpdateDisplay("800x600,800x600");
// TODO: SetLayoutForCurrentDisplays() needs to ported to mash.
// http://crbug.com/698043.
- Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
+ Shell::Get()->display_manager()->SetLayoutForCurrentDisplays(
display::test::CreateDisplayLayout(display_manager(),
display::DisplayPlacement::RIGHT, 0));
// Put the primary monitor's shelf on the display boundary.
@@ -1051,7 +1051,7 @@
// The tested behavior relies on the app list presenter implementation.
test::TestAppListViewPresenterImpl app_list_presenter_impl;
- Shell::GetInstance()->UpdateShelfVisibility();
+ Shell::Get()->UpdateShelfVisibility();
EXPECT_FALSE(app_list_presenter_impl.GetTargetVisibility());
EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->GetVisibilityState());
EXPECT_EQ(SHELF_AUTO_HIDE, shelf_2->GetVisibilityState());
@@ -1064,7 +1064,7 @@
// Show the app list; only the shelf on the same display should be shown.
app_list_presenter_impl.Show(GetPrimaryDisplayId());
- Shell::GetInstance()->UpdateShelfVisibility();
+ Shell::Get()->UpdateShelfVisibility();
EXPECT_TRUE(app_list_presenter_impl.GetTargetVisibility());
EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->GetVisibilityState());
EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf_1->GetAutoHideState());
@@ -1073,7 +1073,7 @@
// Hide the app list, both shelves should be hidden.
app_list_presenter_impl.Dismiss();
- Shell::GetInstance()->UpdateShelfVisibility();
+ Shell::Get()->UpdateShelfVisibility();
EXPECT_FALSE(app_list_presenter_impl.GetTargetVisibility());
EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->GetVisibilityState());
EXPECT_EQ(SHELF_AUTO_HIDE, shelf_2->GetVisibilityState());
@@ -1132,7 +1132,7 @@
wm_shell->SimulateModalWindowOpenForTesting(true);
EXPECT_TRUE(wm_shell->IsSystemModalWindowOpen());
EXPECT_FALSE(wm::CanActivateWindow(window));
- Shell::GetInstance()->UpdateShelfVisibility();
+ Shell::Get()->UpdateShelfVisibility();
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
}
@@ -1179,7 +1179,7 @@
EXPECT_TRUE(wm_shell->IsSystemModalWindowOpen());
EXPECT_FALSE(wm::CanActivateWindow(window_1));
EXPECT_FALSE(wm::CanActivateWindow(window_2));
- Shell::GetInstance()->UpdateShelfVisibility();
+ Shell::Get()->UpdateShelfVisibility();
EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->GetVisibilityState());
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_1->GetAutoHideState());
EXPECT_EQ(SHELF_AUTO_HIDE, shelf_2->GetVisibilityState());
@@ -1594,9 +1594,8 @@
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType());
- Shell::GetInstance()
- ->lock_state_controller()
- ->StartLockAnimationAndLockImmediately(false);
+ Shell::Get()->lock_state_controller()->StartLockAnimationAndLockImmediately(
+ false);
EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType());
}
@@ -1726,7 +1725,7 @@
if (WmShell::Get()->IsRunningInMash())
return;
- Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true);
+ Shell::Get()->display_manager()->SetUnifiedDesktopEnabled(true);
UpdateDisplay("500x400, 500x400");
StatusAreaWidget* status_area_widget = GetShelfWidget()->status_area_widget();
@@ -1781,7 +1780,7 @@
ShelfLayoutManager* layout_manager = GetShelfLayoutManager();
keyboard::SetAccessibilityKeyboardEnabled(true);
InitKeyboardBounds();
- Shell::GetInstance()->CreateKeyboard();
+ Shell::Get()->CreateKeyboard();
keyboard::KeyboardController* kb_controller =
keyboard::KeyboardController::GetInstance();
gfx::Rect orig_work_area(
@@ -1819,7 +1818,7 @@
ShelfLayoutManager* layout_manager = GetShelfLayoutManager();
InitKeyboardBounds();
- Shell::GetInstance()->CreateKeyboard();
+ Shell::Get()->CreateKeyboard();
keyboard::KeyboardController* kb_controller =
keyboard::KeyboardController::GetInstance();
gfx::Rect orig_work_area(
diff --git a/ash/shelf/shelf_widget_unittest.cc b/ash/shelf/shelf_widget_unittest.cc
index c38e786..1c61e03 100644
--- a/ash/shelf/shelf_widget_unittest.cc
+++ b/ash/shelf/shelf_widget_unittest.cc
@@ -333,11 +333,9 @@
public:
ShelfInitializer(ShelfAlignment alignment, ShelfAutoHideBehavior auto_hide)
: alignment_(alignment), auto_hide_(auto_hide) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
- ~ShelfInitializer() override {
- Shell::GetInstance()->RemoveShellObserver(this);
- }
+ ~ShelfInitializer() override { Shell::Get()->RemoveShellObserver(this); }
// ShellObserver:
void OnShelfCreatedForRootWindow(WmWindow* root_window) override {
diff --git a/ash/shell.cc b/ash/shell.cc
index 053206c..1d7e60c4 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -286,7 +286,7 @@
// static
WmWindow* Shell::GetWmRootWindowForNewWindows() {
CHECK(Shell::HasInstance());
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
if (shell->scoped_root_window_for_new_windows_)
return shell->scoped_root_window_for_new_windows_;
return shell->root_window_for_new_windows_;
@@ -314,7 +314,7 @@
// static
Config Shell::GetAshConfig() {
- return GetInstance()->wm_shell_->GetAshConfig();
+ return Get()->wm_shell_->GetAshConfig();
}
views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView(
diff --git a/ash/shell.h b/ash/shell.h
index 4c0bd56..b185c031 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -202,9 +202,6 @@
static Shell* CreateInstance(const ShellInitParams& init_params);
// Should never be called before |CreateInstance()|.
- // TODO: deprecated. Use Get() instead. GetInstance() will be renamed close
- // to branch point.
- static Shell* GetInstance() { return Get(); }
static Shell* Get();
// Returns true if the ash shell has been instantiated.
diff --git a/ash/shell/content/client/shell_browser_main_parts.cc b/ash/shell/content/client/shell_browser_main_parts.cc
index ab54ee8..1be1942 100644
--- a/ash/shell/content/client/shell_browser_main_parts.cc
+++ b/ash/shell/content/client/shell_browser_main_parts.cc
@@ -61,7 +61,7 @@
// Overridden from views::TestViewsDelegate:
views::NonClientFrameView* CreateDefaultNonClientFrameView(
views::Widget* widget) override {
- return ash::Shell::GetInstance()->CreateDefaultNonClientFrameView(widget);
+ return ash::Shell::Get()->CreateDefaultNonClientFrameView(widget);
}
void OnBeforeWidgetInit(
views::Widget::InitParams* params,
diff --git a/ash/shell/example_session_controller_client.cc b/ash/shell/example_session_controller_client.cc
index 9469007..aebf375a 100644
--- a/ash/shell/example_session_controller_client.cc
+++ b/ash/shell/example_session_controller_client.cc
@@ -46,12 +46,12 @@
void ExampleSessionControllerClient::RequestLockScreen() {
TestSessionControllerClient::RequestLockScreen();
shell::CreateLockScreen();
- Shell::GetInstance()->UpdateShelfVisibility();
+ Shell::Get()->UpdateShelfVisibility();
}
void ExampleSessionControllerClient::UnlockScreen() {
TestSessionControllerClient::UnlockScreen();
- Shell::GetInstance()->UpdateShelfVisibility();
+ Shell::Get()->UpdateShelfVisibility();
}
} // namespace shell
diff --git a/ash/shell/lock_view.cc b/ash/shell/lock_view.cc
index 9d39c0d..fdcd500 100644
--- a/ash/shell/lock_view.cc
+++ b/ash/shell/lock_view.cc
@@ -98,8 +98,7 @@
widget->GetNativeView()->Focus();
// TODO: it shouldn't be necessary to invoke UpdateTooltip() here.
- Shell::GetInstance()->tooltip_controller()->UpdateTooltip(
- widget->GetNativeView());
+ Shell::Get()->tooltip_controller()->UpdateTooltip(widget->GetNativeView());
}
} // namespace shell
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 76e8528..d15aee8f0 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -462,7 +462,7 @@
if (WmShell::Get()->IsRunningInMash())
return;
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
ui::EventTargetTestApi test_api(shell);
test::ShellTestApi shell_test_api(shell);
diff --git a/ash/system/chromeos/power/power_event_observer.cc b/ash/system/chromeos/power/power_event_observer.cc
index b18e340f..2e44427 100644
--- a/ash/system/chromeos/power/power_event_observer.cc
+++ b/ash/system/chromeos/power/power_event_observer.cc
@@ -71,7 +71,7 @@
}
void PowerEventObserver::BrightnessChanged(int level, bool user_initiated) {
- Shell::GetInstance()->power_button_controller()->OnScreenBrightnessChanged(
+ Shell::Get()->power_button_controller()->OnScreenBrightnessChanged(
static_cast<double>(level));
}
@@ -122,7 +122,7 @@
// TODO(derat): After mus exposes a method for suspending displays, call it
// here: http://crbug.com/692193
if (!WmShell::Get()->IsRunningInMash()) {
- Shell::GetInstance()->display_configurator()->SuspendDisplays(base::Bind(
+ Shell::Get()->display_configurator()->SuspendDisplays(base::Bind(
&OnSuspendDisplaysCompleted, chromeos::DBusThreadManager::Get()
->GetPowerManagerClient()
->GetSuspendReadinessCallback()));
@@ -133,7 +133,7 @@
// TODO(derat): After mus exposes a method for resuming displays, call it
// here: http://crbug.com/692193
if (!WmShell::Get()->IsRunningInMash())
- Shell::GetInstance()->display_configurator()->ResumeDisplays();
+ Shell::Get()->display_configurator()->ResumeDisplays();
Shell::Get()->system_tray_notifier()->NotifyRefreshClock();
// If the suspend request was being blocked while waiting for the lock
diff --git a/ash/system/chromeos/power/tablet_power_button_controller.cc b/ash/system/chromeos/power/tablet_power_button_controller.cc
index 29c586a9..349399be 100644
--- a/ash/system/chromeos/power/tablet_power_button_controller.cc
+++ b/ash/system/chromeos/power/tablet_power_button_controller.cc
@@ -82,21 +82,21 @@
weak_ptr_factory_(this) {
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(
this);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
// TODO(mash): Provide a way for this class to observe stylus events:
// http://crbug.com/682460
if (ui::InputDeviceManager::HasInstance())
ui::InputDeviceManager::GetInstance()->AddObserver(this);
- Shell::GetInstance()->PrependPreTargetHandler(this);
+ Shell::Get()->PrependPreTargetHandler(this);
GetInitialBacklightsForcedOff();
}
TabletPowerButtonController::~TabletPowerButtonController() {
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
if (ui::InputDeviceManager::HasInstance())
ui::InputDeviceManager::GetInstance()->RemoveObserver(this);
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(
this);
}
@@ -222,7 +222,7 @@
delegate->UpdateTouchscreenStatusFromPrefs();
// Send an a11y alert.
- Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert(
+ Shell::Get()->accessibility_delegate()->TriggerAccessibilityAlert(
forced_off ? A11Y_ALERT_SCREEN_OFF : A11Y_ALERT_SCREEN_ON);
}
diff --git a/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc b/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
index ae059342..6a1917b 100644
--- a/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
+++ b/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
@@ -56,8 +56,8 @@
switches::kAshEnableTouchView);
AshTestBase::SetUp();
- lock_state_controller_ = Shell::GetInstance()->lock_state_controller();
- tablet_controller_ = Shell::GetInstance()
+ lock_state_controller_ = Shell::Get()->lock_state_controller();
+ tablet_controller_ = Shell::Get()
->power_button_controller()
->tablet_power_button_controller_for_test();
test_api_ = base::MakeUnique<TabletPowerButtonController::TestApi>(
diff --git a/ash/system/chromeos/power/video_activity_notifier.cc b/ash/system/chromeos/power/video_activity_notifier.cc
index 09360e6..f18e5dc 100644
--- a/ash/system/chromeos/power/video_activity_notifier.cc
+++ b/ash/system/chromeos/power/video_activity_notifier.cc
@@ -25,14 +25,14 @@
video_state_(detector->state()),
screen_is_locked_(Shell::Get()->session_controller()->IsScreenLocked()) {
detector_->AddObserver(this);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
MaybeNotifyPowerManager();
UpdateTimer();
}
VideoActivityNotifier::~VideoActivityNotifier() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
detector_->RemoveObserver(this);
}
diff --git a/ash/system/chromeos/rotation/tray_rotation_lock.cc b/ash/system/chromeos/rotation/tray_rotation_lock.cc
index 58edb69..7dbf7c5 100644
--- a/ash/system/chromeos/rotation/tray_rotation_lock.cc
+++ b/ash/system/chromeos/rotation/tray_rotation_lock.cc
@@ -34,9 +34,7 @@
}
bool IsUserRotationLocked() {
- return Shell::GetInstance()
- ->screen_orientation_controller()
- ->user_rotation_locked();
+ return Shell::Get()->screen_orientation_controller()->user_rotation_locked();
}
} // namespace
@@ -92,14 +90,14 @@
SetInkDropMode(InkDropHostView::InkDropMode::ON);
SetVisible(IsMaximizeModeWindowManagerEnabled());
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
if (IsMaximizeModeWindowManagerEnabled())
- Shell::GetInstance()->screen_orientation_controller()->AddObserver(this);
+ Shell::Get()->screen_orientation_controller()->AddObserver(this);
}
RotationLockDefaultView::~RotationLockDefaultView() {
StopObservingRotation();
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void RotationLockDefaultView::Update() {
@@ -121,7 +119,7 @@
void RotationLockDefaultView::StopObservingRotation() {
ScreenOrientationController* controller =
- Shell::GetInstance()->screen_orientation_controller();
+ Shell::Get()->screen_orientation_controller();
if (controller)
controller->RemoveObserver(this);
}
@@ -133,16 +131,14 @@
}
bool RotationLockDefaultView::PerformAction(const ui::Event& event) {
- Shell::GetInstance()
- ->screen_orientation_controller()
- ->ToggleUserRotationLock();
+ Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock();
return true;
}
void RotationLockDefaultView::OnMaximizeModeStarted() {
Update();
SetVisible(true);
- Shell::GetInstance()->screen_orientation_controller()->AddObserver(this);
+ Shell::Get()->screen_orientation_controller()->AddObserver(this);
}
void RotationLockDefaultView::OnMaximizeModeEnded() {
@@ -160,11 +156,11 @@
: TrayImageItem(system_tray,
kSystemTrayRotationLockLockedIcon,
UMA_ROTATION_LOCK) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
TrayRotationLock::~TrayRotationLock() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void TrayRotationLock::OnUserRotationLockChanged() {
@@ -179,7 +175,7 @@
void TrayRotationLock::OnMaximizeModeStarted() {
tray_view()->SetVisible(IsUserRotationLocked());
- Shell::GetInstance()->screen_orientation_controller()->AddObserver(this);
+ Shell::Get()->screen_orientation_controller()->AddObserver(this);
}
void TrayRotationLock::OnMaximizeModeEnded() {
@@ -189,7 +185,7 @@
void TrayRotationLock::DestroyTrayView() {
StopObservingRotation();
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
TrayImageItem::DestroyTrayView();
}
@@ -211,7 +207,7 @@
void TrayRotationLock::StopObservingRotation() {
ScreenOrientationController* controller =
- Shell::GetInstance()->screen_orientation_controller();
+ Shell::Get()->screen_orientation_controller();
if (controller)
controller->RemoveObserver(this);
}
diff --git a/ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc b/ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc
index 1676ddb..df2cefc 100644
--- a/ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc
+++ b/ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc
@@ -133,9 +133,7 @@
TearDownViews();
Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
true);
- Shell::GetInstance()
- ->screen_orientation_controller()
- ->ToggleUserRotationLock();
+ Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock();
SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget());
EXPECT_TRUE(tray_view()->visible());
Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
@@ -149,9 +147,7 @@
ASSERT_FALSE(tray_view()->visible());
Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
true);
- Shell::GetInstance()
- ->screen_orientation_controller()
- ->ToggleUserRotationLock();
+ Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock();
EXPECT_TRUE(tray_view()->visible());
Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
false);
@@ -220,7 +216,7 @@
MaximizeModeController* maximize_mode_controller =
Shell::Get()->maximize_mode_controller();
ScreenOrientationController* screen_orientation_controller =
- Shell::GetInstance()->screen_orientation_controller();
+ Shell::Get()->screen_orientation_controller();
ASSERT_FALSE(screen_orientation_controller->rotation_locked());
maximize_mode_controller->EnableMaximizeModeWindowManager(true);
ASSERT_FALSE(tray_view()->visible());
@@ -262,9 +258,7 @@
Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
true);
DestroyTrayView();
- Shell::GetInstance()
- ->screen_orientation_controller()
- ->ToggleUserRotationLock();
+ Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock();
Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
false);
}
diff --git a/ash/system/chromeos/screen_layout_observer.cc b/ash/system/chromeos/screen_layout_observer.cc
index 92157c4..205e4042 100644
--- a/ash/system/chromeos/screen_layout_observer.cc
+++ b/ash/system/chromeos/screen_layout_observer.cc
@@ -39,7 +39,7 @@
namespace {
display::DisplayManager* GetDisplayManager() {
- return Shell::GetInstance()->display_manager();
+ return Shell::Get()->display_manager();
}
base::string16 GetDisplayName(int64_t display_id) {
@@ -337,7 +337,7 @@
// Don't display notifications for accelerometer triggered screen rotations.
// See http://crbug.com/364949
- if (Shell::GetInstance()
+ if (Shell::Get()
->screen_orientation_controller()
->ignore_display_configuration_updates()) {
return;
diff --git a/ash/system/chromeos/screen_layout_observer_unittest.cc b/ash/system/chromeos/screen_layout_observer_unittest.cc
index 193b254..50bf615 100644
--- a/ash/system/chromeos/screen_layout_observer_unittest.cc
+++ b/ash/system/chromeos/screen_layout_observer_unittest.cc
@@ -55,7 +55,7 @@
ScreenLayoutObserverTest::~ScreenLayoutObserverTest() {}
ScreenLayoutObserver* ScreenLayoutObserverTest::GetScreenLayoutObserver() {
- return Shell::GetInstance()->screen_layout_observer();
+ return Shell::Get()->screen_layout_observer();
}
void ScreenLayoutObserverTest::CloseNotification() {
@@ -103,9 +103,8 @@
}
TEST_F(ScreenLayoutObserverTest, DisplayNotifications) {
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
UpdateDisplay("400x400");
display::Display::SetInternalDisplayId(display_manager()->first_display_id());
@@ -207,9 +206,8 @@
// Verify that notification shows up when display is switched from dock mode to
// extend mode.
TEST_F(ScreenLayoutObserverTest, DisplayConfigurationChangedTwice) {
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
UpdateDisplay("400x400,200x200");
EXPECT_EQ(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED_NO_INTERNAL),
@@ -237,9 +235,8 @@
TEST_F(ScreenLayoutObserverTest, UpdateAfterSuppressDisplayNotification) {
UpdateDisplay("400x400,200x200");
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
// Rotate the second.
UpdateDisplay("400x400,200x200/r");
@@ -253,9 +250,8 @@
// Verify that no notification is shown when overscan of a screen is changed.
TEST_F(ScreenLayoutObserverTest, OverscanDisplay) {
UpdateDisplay("400x400, 300x300");
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
display::Display::SetInternalDisplayId(display_manager()->first_display_id());
// /o creates the default overscan.
@@ -264,7 +260,7 @@
EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty());
// Reset the overscan.
- Shell::GetInstance()->display_manager()->SetOverscanInsets(
+ Shell::Get()->display_manager()->SetOverscanInsets(
display_manager()->GetSecondaryDisplay().id(), gfx::Insets());
EXPECT_TRUE(GetDisplayNotificationText().empty());
EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty());
@@ -273,9 +269,8 @@
// Tests that exiting mirror mode by closing the lid shows the correct "exiting
// mirror mode" message.
TEST_F(ScreenLayoutObserverTest, ExitMirrorModeBecauseOfDockedModeMessage) {
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
UpdateDisplay("400x400,200x200");
display::Display::SetInternalDisplayId(
display_manager()->GetSecondaryDisplay().id());
@@ -299,9 +294,8 @@
// Tests that exiting mirror mode because of adding a third display shows the
// correct "3+ displays mirror mode is not supported" message.
TEST_F(ScreenLayoutObserverTest, ExitMirrorModeBecauseOfThirdDisplayMessage) {
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
UpdateDisplay("400x400,200x200");
display::Display::SetInternalDisplayId(
display_manager()->GetSecondaryDisplay().id());
@@ -325,9 +319,8 @@
// correct message.
TEST_F(ScreenLayoutObserverTest,
ExitMirrorModeNoInternalDisplayBecauseOfDisplayRemovedMessage) {
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
UpdateDisplay("400x400,200x200");
display::Display::SetInternalDisplayId(
display_manager()->GetSecondaryDisplay().id());
@@ -350,9 +343,8 @@
// Tests notification messages shown when adding and removing displays in
// extended mode.
TEST_F(ScreenLayoutObserverTest, AddingRemovingDisplayExtendedModeMessage) {
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
UpdateDisplay("400x400");
EXPECT_TRUE(GetDisplayNotificationText().empty());
@@ -375,9 +367,8 @@
// Tests notification messages shown when entering and exiting unified desktop
// mode.
TEST_F(ScreenLayoutObserverTest, EnteringExitingUnifiedModeMessage) {
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
UpdateDisplay("400x400");
EXPECT_TRUE(GetDisplayNotificationText().empty());
@@ -416,9 +407,8 @@
// Special case: Tests notification messages shown when entering docked mode
// by closing the lid and the internal display is the secondary display.
TEST_F(ScreenLayoutObserverTest, DockedModeWithExternalPrimaryDisplayMessage) {
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
UpdateDisplay("400x400,200x200");
EXPECT_EQ(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED_NO_INTERNAL),
diff --git a/ash/system/toast/toast_manager_unittest.cc b/ash/system/toast/toast_manager_unittest.cc
index 4ae8eeac..e25b45bf 100644
--- a/ash/system/toast/toast_manager_unittest.cc
+++ b/ash/system/toast/toast_manager_unittest.cc
@@ -34,7 +34,7 @@
void SetUp() override {
test::AshTestBase::SetUp();
- manager_ = Shell::GetInstance()->toast_manager();
+ manager_ = Shell::Get()->toast_manager();
manager_->ResetSerialForTesting();
EXPECT_EQ(0, GetToastSerial());
diff --git a/ash/system/web_notification/web_notification_tray_unittest.cc b/ash/system/web_notification/web_notification_tray_unittest.cc
index 5b00cc1..6e420ad 100644
--- a/ash/system/web_notification/web_notification_tray_unittest.cc
+++ b/ash/system/web_notification/web_notification_tray_unittest.cc
@@ -257,9 +257,8 @@
if (WmShell::Get()->IsRunningInMash())
return;
- Shell::GetInstance()
- ->screen_layout_observer()
- ->set_show_notifications_for_testing(true);
+ Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing(
+ true);
UpdateDisplay("400x400,200x200");
// UpdateDisplay() creates the display notifications, so popup is visible.
EXPECT_TRUE(GetTray()->IsPopupVisible());
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index 4de0ba7e..edeefcd5 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -138,7 +138,7 @@
Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
// TODO: mus/mash needs to support CursorManager. http://crbug.com/637853.
if (Shell::GetAshConfig() == Config::CLASSIC)
- Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
+ Shell::Get()->cursor_manager()->EnableMouseEvents();
// Changing GestureConfiguration shouldn't make tests fail. These values
// prevent unexpected events from being generated during tests. Such as
@@ -152,7 +152,7 @@
void AshTestBase::TearDown() {
teardown_called_ = true;
- Shell::GetInstance()->OnAppTerminating();
+ Shell::Get()->OnAppTerminating();
// Flush the message loop to finish pending release tasks.
RunAllPendingInMessageLoop();
@@ -174,7 +174,7 @@
// static
SystemTray* AshTestBase::GetPrimarySystemTray() {
- return Shell::GetInstance()->GetPrimarySystemTray();
+ return Shell::Get()->GetPrimarySystemTray();
}
ui::test::EventGenerator& AshTestBase::GetEventGenerator() {
@@ -187,7 +187,7 @@
// static
display::Display::Rotation AshTestBase::GetActiveDisplayRotation(int64_t id) {
- return Shell::GetInstance()
+ return Shell::Get()
->display_manager()
->GetDisplayInfo(id)
.GetActiveRotation();
@@ -203,8 +203,7 @@
if (Shell::GetAshConfig() != Config::CLASSIC) {
ash_test_helper_->UpdateDisplayForMash(display_specs);
} else {
- display::test::DisplayManagerTestApi(
- Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.UpdateDisplay(display_specs);
}
}
@@ -341,7 +340,7 @@
case BLOCKED_BY_LOCK_SCREEN:
SetSessionStarted(true);
Shell::Get()->session_controller()->LockScreenAndFlushForTest();
- Shell::GetInstance()->OnLockStateChanged(true);
+ Shell::Get()->OnLockStateChanged(true);
break;
case BLOCKED_BY_LOGIN_SCREEN:
SetSessionStarted(false);
@@ -366,23 +365,19 @@
if (WmShell::Get()->IsRunningInMash())
return;
- Shell::GetInstance()->RemovePreTargetHandler(
- Shell::GetInstance()
- ->window_tree_host_manager()
- ->input_method_event_handler());
+ Shell::Get()->RemovePreTargetHandler(
+ Shell::Get()->window_tree_host_manager()->input_method_event_handler());
}
display::DisplayManager* AshTestBase::display_manager() {
- return Shell::GetInstance()->display_manager();
+ return Shell::Get()->display_manager();
}
bool AshTestBase::TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator,
const gfx::Point& point_in_screen) {
- DCHECK(!Shell::GetInstance()->display_manager()->IsInUnifiedMode());
+ DCHECK(!Shell::Get()->display_manager()->IsInUnifiedMode());
static_cast<ExtendedMouseWarpController*>(
- Shell::GetInstance()
- ->mouse_cursor_filter()
- ->mouse_warp_controller_for_test())
+ Shell::Get()->mouse_cursor_filter()->mouse_warp_controller_for_test())
->allow_non_native_event_for_test();
display::Screen* screen = display::Screen::GetScreen();
display::Display original_display =
@@ -398,7 +393,7 @@
void AshTestBase::SwapPrimaryDisplay() {
if (display::Screen::GetScreen()->GetNumDisplays() <= 1)
return;
- Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId(
+ Shell::Get()->window_tree_host_manager()->SetPrimaryDisplayId(
display_manager()->GetSecondaryDisplay().id());
}
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc
index b18a6c9..89e610fe 100644
--- a/ash/test/ash_test_helper.cc
+++ b/ash/test/ash_test_helper.cc
@@ -142,11 +142,11 @@
aura::test::EnvTestHelper().SetInputStateLookup(
std::unique_ptr<aura::InputStateLookup>());
+ Shell* shell = Shell::Get();
session_controller_client_.reset(
- new TestSessionControllerClient(Shell::Get()->session_controller()));
+ new TestSessionControllerClient(shell->session_controller()));
session_controller_client_->InitializeAndBind();
- Shell* shell = Shell::GetInstance();
if (start_session)
session_controller_client_->CreatePredefinedUserSessions(1);
@@ -158,8 +158,7 @@
shell->screen_layout_observer()->set_show_notifications_for_testing(false);
// DisplayManager is specific to classic-ash.
- display::test::DisplayManagerTestApi(
- Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(shell->display_manager())
.DisableChangeDisplayUponHostResize();
DisplayConfigurationControllerTestApi(
shell->display_configuration_controller())
@@ -278,7 +277,7 @@
display::Display AshTestHelper::GetSecondaryDisplay() {
if (config_ == Config::CLASSIC)
- return Shell::GetInstance()->display_manager()->GetSecondaryDisplay();
+ return Shell::Get()->display_manager()->GetSecondaryDisplay();
std::vector<RootWindowController*> roots = GetRootsOrderedByDisplayId();
CHECK_LE(2U, roots.size());
diff --git a/ash/test/ash_test_impl_aura.cc b/ash/test/ash_test_impl_aura.cc
index 75fb8ec..6cda4e0 100644
--- a/ash/test/ash_test_impl_aura.cc
+++ b/ash/test/ash_test_impl_aura.cc
@@ -79,15 +79,15 @@
}
display::Display AshTestImplAura::GetSecondaryDisplay() {
- return Shell::GetInstance()->display_manager()->GetSecondaryDisplay();
+ return Shell::Get()->display_manager()->GetSecondaryDisplay();
}
bool AshTestImplAura::SetSecondaryDisplayPlacement(
display::DisplayPlacement::Position position,
int offset) {
- Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
- display::test::CreateDisplayLayout(
- Shell::GetInstance()->display_manager(), position, 0));
+ Shell::Get()->display_manager()->SetLayoutForCurrentDisplays(
+ display::test::CreateDisplayLayout(Shell::Get()->display_manager(),
+ position, 0));
return true;
}
diff --git a/ash/test/ash_test_views_delegate.cc b/ash/test/ash_test_views_delegate.cc
index 256e768..980b6d32 100644
--- a/ash/test/ash_test_views_delegate.cc
+++ b/ash/test/ash_test_views_delegate.cc
@@ -21,7 +21,7 @@
if (!params->parent && !params->context && ash::Shell::HasInstance()) {
// If the window has neither a parent nor a context add to the root.
- params->parent = ash::Shell::GetInstance()->GetPrimaryRootWindow();
+ params->parent = ash::Shell::Get()->GetPrimaryRootWindow();
}
}
diff --git a/ash/test/cursor_manager_test_api.cc b/ash/test/cursor_manager_test_api.cc
index f5b033d..4d3e8788 100644
--- a/ash/test/cursor_manager_test_api.cc
+++ b/ash/test/cursor_manager_test_api.cc
@@ -30,13 +30,13 @@
display::Display::Rotation CursorManagerTestApi::GetCurrentCursorRotation()
const {
- return ShellTestApi(Shell::GetInstance())
+ return ShellTestApi(Shell::Get())
.ash_native_cursor_manager()
->image_cursors_->GetRotation();
}
float CursorManagerTestApi::GetCurrentCursorScale() const {
- return ShellTestApi(Shell::GetInstance())
+ return ShellTestApi(Shell::Get())
.ash_native_cursor_manager()
->image_cursors_->GetScale();
}
diff --git a/ash/test/mirror_window_test_api.cc b/ash/test/mirror_window_test_api.cc
index 5f687f8..8a65b84 100644
--- a/ash/test/mirror_window_test_api.cc
+++ b/ash/test/mirror_window_test_api.cc
@@ -16,7 +16,7 @@
namespace test {
const aura::WindowTreeHost* MirrorWindowTestApi::GetHost() const {
- aura::Window* window = Shell::GetInstance()
+ aura::Window* window = Shell::Get()
->window_tree_host_manager()
->mirror_window_controller()
->GetWindow();
@@ -24,14 +24,14 @@
}
int MirrorWindowTestApi::GetCurrentCursorType() const {
- return Shell::GetInstance()
+ return Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->cursor_type_;
}
const gfx::Point& MirrorWindowTestApi::GetCursorHotPoint() const {
- return Shell::GetInstance()
+ return Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->hot_point_;
@@ -43,7 +43,7 @@
}
const aura::Window* MirrorWindowTestApi::GetCursorWindow() const {
- return Shell::GetInstance()
+ return Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->cursor_window_.get();
diff --git a/ash/test/shell_test_api.cc b/ash/test/shell_test_api.cc
index c81507e..a955c37 100644
--- a/ash/test/shell_test_api.cc
+++ b/ash/test/shell_test_api.cc
@@ -13,7 +13,7 @@
namespace ash {
namespace test {
-ShellTestApi::ShellTestApi() : ShellTestApi(Shell::GetInstance()) {}
+ShellTestApi::ShellTestApi() : ShellTestApi(Shell::Get()) {}
ShellTestApi::ShellTestApi(Shell* shell) : shell_(shell) {}
diff --git a/ash/test/test_wallpaper_delegate.cc b/ash/test/test_wallpaper_delegate.cc
index 1296314..6ffeaf3 100644
--- a/ash/test/test_wallpaper_delegate.cc
+++ b/ash/test/test_wallpaper_delegate.cc
@@ -17,7 +17,7 @@
void TestWallpaperDelegate::UpdateWallpaper(bool clear_cache) {
DefaultWallpaperDelegate::UpdateWallpaper(clear_cache);
if (!custom_wallpaper_.isNull()) {
- Shell::GetInstance()->wallpaper_controller()->SetWallpaperImage(
+ Shell::Get()->wallpaper_controller()->SetWallpaperImage(
custom_wallpaper_, wallpaper::WALLPAPER_LAYOUT_STRETCH);
}
update_wallpaper_count_++;
diff --git a/ash/tooltips/tooltip_controller_unittest.cc b/ash/tooltips/tooltip_controller_unittest.cc
index f73dc6e..30adb05 100644
--- a/ash/tooltips/tooltip_controller_unittest.cc
+++ b/ash/tooltips/tooltip_controller_unittest.cc
@@ -119,16 +119,16 @@
return;
// Disable mouse event which hides the cursor and check again.
- ash::Shell::GetInstance()->cursor_manager()->DisableMouseEvents();
+ ash::Shell::Get()->cursor_manager()->DisableMouseEvents();
RunAllPendingInMessageLoop();
- EXPECT_FALSE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
+ EXPECT_FALSE(ash::Shell::Get()->cursor_manager()->IsCursorVisible());
helper_->UpdateIfRequired();
EXPECT_FALSE(helper_->IsTooltipVisible());
// Enable mouse event which shows the cursor and re-check.
- ash::Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
+ ash::Shell::Get()->cursor_manager()->EnableMouseEvents();
RunAllPendingInMessageLoop();
- EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
+ EXPECT_TRUE(ash::Shell::Get()->cursor_manager()->IsCursorVisible());
helper_->UpdateIfRequired();
EXPECT_TRUE(helper_->IsTooltipVisible());
}
diff --git a/ash/touch/ash_touch_transform_controller.cc b/ash/touch/ash_touch_transform_controller.cc
index bc7be76..3681476 100644
--- a/ash/touch/ash_touch_transform_controller.cc
+++ b/ash/touch/ash_touch_transform_controller.cc
@@ -13,11 +13,11 @@
display::DisplayConfigurator* display_configurator,
display::DisplayManager* display_manager)
: TouchTransformController(display_configurator, display_manager) {
- Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ Shell::Get()->window_tree_host_manager()->AddObserver(this);
}
AshTouchTransformController::~AshTouchTransformController() {
- Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
+ Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
}
void AshTouchTransformController::OnDisplaysInitialized() {
diff --git a/ash/touch/touch_hud_debug.cc b/ash/touch/touch_hud_debug.cc
index 7979873..fa40050 100644
--- a/ash/touch/touch_hud_debug.cc
+++ b/ash/touch/touch_hud_debug.cc
@@ -323,7 +323,7 @@
canvas_(NULL),
label_container_(NULL) {
const display::Display& display =
- Shell::GetInstance()->display_manager()->GetDisplayForId(display_id());
+ Shell::Get()->display_manager()->GetDisplayForId(display_id());
views::View* content = widget()->GetContentsView();
@@ -356,7 +356,7 @@
// static
std::unique_ptr<base::DictionaryValue> TouchHudDebug::GetAllAsDictionary() {
std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
- aura::Window::Windows roots = Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows roots = Shell::Get()->GetAllRootWindows();
for (aura::Window::Windows::iterator iter = roots.begin();
iter != roots.end(); ++iter) {
RootWindowController* controller = GetRootWindowController(*iter);
diff --git a/ash/touch/touch_observer_hud.cc b/ash/touch/touch_observer_hud.cc
index 4e30256..2292576f0 100644
--- a/ash/touch/touch_observer_hud.cc
+++ b/ash/touch/touch_observer_hud.cc
@@ -22,7 +22,7 @@
root_window_(initial_root),
widget_(NULL) {
const display::Display& display =
- Shell::GetInstance()->display_manager()->GetDisplayForId(display_id_);
+ Shell::Get()->display_manager()->GetDisplayForId(display_id_);
views::View* content = new views::View;
@@ -47,14 +47,14 @@
// Observe changes in display size and mode to update touch HUD.
display::Screen::GetScreen()->AddObserver(this);
- Shell::GetInstance()->display_configurator()->AddObserver(this);
- Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ Shell::Get()->display_configurator()->AddObserver(this);
+ Shell::Get()->window_tree_host_manager()->AddObserver(this);
root_window_->AddPreTargetHandler(this);
}
TouchObserverHUD::~TouchObserverHUD() {
- Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
- Shell::GetInstance()->display_configurator()->RemoveObserver(this);
+ Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
+ Shell::Get()->display_configurator()->RemoveObserver(this);
display::Screen::GetScreen()->RemoveObserver(this);
widget_->RemoveObserver(this);
@@ -126,9 +126,9 @@
if (root_window_)
return;
- root_window_ = Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display_id_);
+ root_window_ =
+ Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display_id_);
views::Widget::ReparentNativeView(
widget_->GetNativeView(),
diff --git a/ash/touch/touch_observer_hud_unittest.cc b/ash/touch/touch_observer_hud_unittest.cc
index bca43314..72634fb 100644
--- a/ash/touch/touch_observer_hud_unittest.cc
+++ b/ash/touch/touch_observer_hud_unittest.cc
@@ -31,9 +31,9 @@
// Initialize display infos. They should be initialized after Ash
// environment is set up, i.e., after test::AshTestBase::SetUp().
- internal_display_id_ = display::test::DisplayManagerTestApi(
- Shell::GetInstance()->display_manager())
- .SetFirstDisplayAsInternalDisplay();
+ internal_display_id_ =
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
+ .SetFirstDisplayAsInternalDisplay();
external_display_id_ = 10;
mirrored_display_id_ = 11;
@@ -118,7 +118,7 @@
protected:
WindowTreeHostManager* GetWindowTreeHostManager() {
- return Shell::GetInstance()->window_tree_host_manager();
+ return Shell::Get()->window_tree_host_manager();
}
const display::Display& GetInternalDisplay() {
@@ -267,11 +267,11 @@
~TouchHudProjectionTest() override {}
void EnableTouchHudProjection() {
- Shell::GetInstance()->SetTouchHudProjectionEnabled(true);
+ Shell::Get()->SetTouchHudProjectionEnabled(true);
}
void DisableTouchHudProjection() {
- Shell::GetInstance()->SetTouchHudProjectionEnabled(false);
+ Shell::Get()->SetTouchHudProjectionEnabled(false);
}
TouchHudProjection* GetInternalTouchHudProjection() {
diff --git a/ash/utility/screenshot_controller.cc b/ash/utility/screenshot_controller.cc
index 5728596..d483fa0 100644
--- a/ash/utility/screenshot_controller.cc
+++ b/ash/utility/screenshot_controller.cc
@@ -34,7 +34,7 @@
// monitors. it will stop the mouse at the any edge of the screen. must
// swtich back on when the screenshot is complete.
void EnableMouseWarp(bool enable) {
- Shell::GetInstance()->mouse_cursor_filter()->set_mouse_warp_enabled(enable);
+ Shell::Get()->mouse_cursor_filter()->set_mouse_warp_enabled(enable);
}
class ScreenshotWindowTargeter : public aura::WindowTargeter {
@@ -54,9 +54,9 @@
display::Display display =
display::Screen::GetScreen()->GetDisplayNearestPoint(location);
- aura::Window* root_window = Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display.id());
+ aura::Window* root_window =
+ Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display.id());
position_client->ConvertPointFromScreen(root_window, &location);
@@ -235,13 +235,13 @@
screenshot_delegate_(nullptr) {
// Keep this here and don't move it to StartPartialScreenshotSession(), as it
// needs to be pre-pended by MouseCursorEventFilter in Shell::Init().
- Shell::GetInstance()->PrependPreTargetHandler(this);
+ Shell::Get()->PrependPreTargetHandler(this);
}
ScreenshotController::~ScreenshotController() {
if (screenshot_delegate_)
CancelScreenshotSession();
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
void ScreenshotController::StartWindowScreenshotSession(
@@ -261,8 +261,8 @@
}
SetSelectedWindow(wm::GetActiveWindow());
- cursor_setter_.reset(new ScopedCursorSetter(
- Shell::GetInstance()->cursor_manager(), ui::kCursorCross));
+ cursor_setter_.reset(
+ new ScopedCursorSetter(Shell::Get()->cursor_manager(), ui::kCursorCross));
EnableMouseWarp(true);
}
@@ -286,8 +286,8 @@
}
if (!pen_events_only_) {
- cursor_setter_.reset(new ScopedCursorSetter(
- Shell::GetInstance()->cursor_manager(), ui::kCursorCross));
+ cursor_setter_.reset(new ScopedCursorSetter(Shell::Get()->cursor_manager(),
+ ui::kCursorCross));
}
EnableMouseWarp(false);
@@ -340,7 +340,7 @@
// called before ctor is called.
cursor_setter_.reset();
cursor_setter_.reset(new ScopedCursorSetter(
- Shell::GetInstance()->cursor_manager(), ui::kCursorNone));
+ Shell::Get()->cursor_manager(), ui::kCursorNone));
}
Update(event);
}
diff --git a/ash/utility/screenshot_controller_unittest.cc b/ash/utility/screenshot_controller_unittest.cc
index 3b65da59b..2b9503d 100644
--- a/ash/utility/screenshot_controller_unittest.cc
+++ b/ash/utility/screenshot_controller_unittest.cc
@@ -28,7 +28,7 @@
protected:
ScreenshotController* screenshot_controller() {
- return Shell::GetInstance()->screenshot_controller();
+ return Shell::Get()->screenshot_controller();
}
bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) {
@@ -53,11 +53,11 @@
}
const gfx::Point& GetStartPosition() const {
- return Shell::GetInstance()->screenshot_controller()->start_position_;
+ return Shell::Get()->screenshot_controller()->start_position_;
}
const aura::Window* GetCurrentSelectedWindow() const {
- return Shell::GetInstance()->screenshot_controller()->selected_;
+ return Shell::Get()->screenshot_controller()->selected_;
}
aura::Window* CreateSelectableWindow(const gfx::Rect& rect) {
@@ -257,7 +257,7 @@
// cursor. See http://crbug.com/462229
TEST_F(PartialScreenshotControllerTest, MouseWarpTest) {
// Create two displays.
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
UpdateDisplay("500x500,500x500");
EXPECT_EQ(2U, shell->display_manager()->GetNumDisplays());
@@ -273,7 +273,7 @@
}
TEST_F(PartialScreenshotControllerTest, VisibilityTest) {
- aura::client::CursorClient* client = Shell::GetInstance()->cursor_manager();
+ aura::client::CursorClient* client = Shell::Get()->cursor_manager();
GetEventGenerator().PressKey(ui::VKEY_A, 0);
GetEventGenerator().ReleaseKey(ui::VKEY_A, 0);
@@ -296,8 +296,8 @@
// Make sure ScreenshotController doesn't prevent handling of large
// cursor. See http://crbug.com/459214
TEST_F(PartialScreenshotControllerTest, LargeCursor) {
- Shell::GetInstance()->cursor_manager()->SetCursorSet(ui::CURSOR_SET_LARGE);
- Shell::GetInstance()
+ Shell::Get()->cursor_manager()->SetCursorSet(ui::CURSOR_SET_LARGE);
+ Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->SetCursorCompositingEnabled(true);
diff --git a/ash/virtual_keyboard_controller.cc b/ash/virtual_keyboard_controller.cc
index c0ec291e..cd6c786 100644
--- a/ash/virtual_keyboard_controller.cc
+++ b/ash/virtual_keyboard_controller.cc
@@ -45,7 +45,7 @@
->DeactivateKeyboard(keyboard::KeyboardController::GetInstance());
for (RootWindowController* controller :
- Shell::GetInstance()->GetAllRootWindowControllers()) {
+ Shell::Get()->GetAllRootWindowControllers()) {
if (display::Screen::GetScreen()
->GetDisplayNearestWindow(controller->GetRootWindow())
.id() == display_id) {
@@ -73,13 +73,13 @@
has_internal_keyboard_(false),
has_touchscreen_(false),
ignore_external_keyboard_(false) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
ui::InputDeviceManager::GetInstance()->AddObserver(this);
UpdateDevices();
}
VirtualKeyboardController::~VirtualKeyboardController() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
ui::InputDeviceManager::GetInstance()->RemoveObserver(this);
}
@@ -211,9 +211,9 @@
if (is_enabled == was_enabled)
return;
if (is_enabled) {
- Shell::GetInstance()->CreateKeyboard();
+ Shell::Get()->CreateKeyboard();
} else {
- Shell::GetInstance()->DeactivateKeyboard();
+ Shell::Get()->DeactivateKeyboard();
}
}
diff --git a/ash/virtual_keyboard_controller_unittest.cc b/ash/virtual_keyboard_controller_unittest.cc
index d66383f..422259e0 100644
--- a/ash/virtual_keyboard_controller_unittest.cc
+++ b/ash/virtual_keyboard_controller_unittest.cc
@@ -196,17 +196,13 @@
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
// Toggle show keyboard. Keyboard should be visible.
ResetObserver();
- Shell::GetInstance()
- ->virtual_keyboard_controller()
- ->ToggleIgnoreExternalKeyboard();
+ Shell::Get()->virtual_keyboard_controller()->ToggleIgnoreExternalKeyboard();
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified());
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
// Toggle show keyboard. Keyboard should be hidden.
ResetObserver();
- Shell::GetInstance()
- ->virtual_keyboard_controller()
- ->ToggleIgnoreExternalKeyboard();
+ Shell::Get()->virtual_keyboard_controller()->ToggleIgnoreExternalKeyboard();
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified());
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
@@ -275,17 +271,13 @@
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
// Toggle show keyboard. Keyboard should be visible.
ResetObserver();
- Shell::GetInstance()
- ->virtual_keyboard_controller()
- ->ToggleIgnoreExternalKeyboard();
+ Shell::Get()->virtual_keyboard_controller()->ToggleIgnoreExternalKeyboard();
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified());
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
// Toggle show keyboard. Keyboard should be hidden.
ResetObserver();
- Shell::GetInstance()
- ->virtual_keyboard_controller()
- ->ToggleIgnoreExternalKeyboard();
+ Shell::Get()->virtual_keyboard_controller()->ToggleIgnoreExternalKeyboard();
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified());
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
diff --git a/ash/wm/ash_focus_rules_unittest.cc b/ash/wm/ash_focus_rules_unittest.cc
index 0909d33b..3f1e51ee 100644
--- a/ash/wm/ash_focus_rules_unittest.cc
+++ b/ash/wm/ash_focus_rules_unittest.cc
@@ -41,7 +41,7 @@
void RequestLockScreen() override {
TestSessionControllerClient::RequestLockScreen();
CreateLockScreen();
- Shell::GetInstance()->UpdateShelfVisibility();
+ Shell::Get()->UpdateShelfVisibility();
}
void UnlockScreen() override {
@@ -51,7 +51,7 @@
lock_screen_widget_.reset(nullptr);
}
- Shell::GetInstance()->UpdateShelfVisibility();
+ Shell::Get()->UpdateShelfVisibility();
}
private:
diff --git a/ash/wm/ash_native_cursor_manager.cc b/ash/wm/ash_native_cursor_manager.cc
index d79bd5d..1bbafbf5 100644
--- a/ash/wm/ash_native_cursor_manager.cc
+++ b/ash/wm/ash_native_cursor_manager.cc
@@ -19,34 +19,31 @@
namespace {
void SetCursorOnAllRootWindows(gfx::NativeCursor cursor) {
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
for (aura::Window::Windows::iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter)
(*iter)->GetHost()->SetCursor(cursor);
- Shell::GetInstance()
+ Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->SetCursor(cursor);
}
void NotifyCursorVisibilityChange(bool visible) {
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
for (aura::Window::Windows::iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter)
(*iter)->GetHost()->OnCursorVisibilityChanged(visible);
- Shell::GetInstance()
+ Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->SetVisibility(visible);
}
void NotifyMouseEventsEnableStateChange(bool enabled) {
- aura::Window::Windows root_windows =
- Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::Get()->GetAllRootWindows();
for (aura::Window::Windows::iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter)
(*iter)->GetHost()->dispatcher()->OnMouseEventsEnableStateChanged(enabled);
@@ -63,7 +60,7 @@
void AshNativeCursorManager::SetNativeCursorEnabled(bool enabled) {
native_cursor_enabled_ = enabled;
- ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager();
SetCursor(cursor_manager->GetCursor(), cursor_manager);
}
@@ -73,7 +70,7 @@
DCHECK(display.is_valid());
// Use the platform's device scale factor instead of the display's, which
// might have been adjusted for the UI scale.
- const float original_scale = Shell::GetInstance()
+ const float original_scale = Shell::Get()
->display_manager()
->GetDisplayInfo(display.id())
.device_scale_factor();
@@ -84,7 +81,7 @@
if (image_cursors_->SetDisplay(display, cursor_scale))
SetCursor(delegate->GetCursor(), delegate);
- Shell::GetInstance()
+ Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->SetDisplay(display);
@@ -124,7 +121,7 @@
if (delegate->IsCursorVisible())
SetCursor(delegate->GetCursor(), delegate);
- Shell::GetInstance()
+ Shell::Get()
->window_tree_host_manager()
->cursor_window_controller()
->SetCursorSet(cursor_set);
diff --git a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc
index 8abfaa4..62a07c4 100644
--- a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc
+++ b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc
@@ -56,7 +56,7 @@
#endif
TEST_F(AshNativeCursorManagerTest, MAYBE_CursorChangeOnEnterNotify) {
- ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager();
test::CursorManagerTestApi test_api(cursor_manager);
display::ManagedDisplayInfo display_info1 =
diff --git a/ash/wm/ash_native_cursor_manager_unittest.cc b/ash/wm/ash_native_cursor_manager_unittest.cc
index e806b749..0b5d327 100644
--- a/ash/wm/ash_native_cursor_manager_unittest.cc
+++ b/ash/wm/ash_native_cursor_manager_unittest.cc
@@ -56,7 +56,7 @@
typedef test::AshTestBase AshNativeCursorManagerTest;
TEST_F(AshNativeCursorManagerTest, LockCursor) {
- ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
cursor_manager->SetCursor(ui::kCursorCopy);
@@ -98,7 +98,7 @@
}
TEST_F(AshNativeCursorManagerTest, SetCursor) {
- ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
cursor_manager->SetCursor(ui::kCursorCopy);
EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type());
@@ -109,7 +109,7 @@
}
TEST_F(AshNativeCursorManagerTest, SetCursorSet) {
- ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
EXPECT_EQ(ui::CURSOR_SET_NORMAL, test_api.GetCurrentCursorSet());
@@ -125,7 +125,7 @@
}
TEST_F(AshNativeCursorManagerTest, SetDeviceScaleFactorAndRotation) {
- ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
UpdateDisplay("800x100*2");
EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
@@ -137,7 +137,7 @@
}
TEST_F(AshNativeCursorManagerTest, FractionalScale) {
- ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
// Cursor should use the resource scale factor.
UpdateDisplay("800x100*1.25");
@@ -148,17 +148,17 @@
int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
display::Display::SetInternalDisplayId(display_id);
- ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
- display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetDisplayUIScale(display_id, 0.5f);
EXPECT_EQ(
1.0f,
display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor());
EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
- display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetDisplayUIScale(display_id, 1.0f);
// 2x display should keep using 2x cursor regardless of the UI scale.
@@ -167,7 +167,7 @@
2.0f,
display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor());
EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
- display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetDisplayUIScale(display_id, 2.0f);
EXPECT_EQ(
1.0f,
diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc
index 0ccaf949..ce9d6d6 100644
--- a/ash/wm/drag_window_resizer.cc
+++ b/ash/wm/drag_window_resizer.cc
@@ -31,7 +31,7 @@
DragWindowResizer::~DragWindowResizer() {
if (window_state_)
window_state_->DeleteDragDetails();
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
shell->mouse_cursor_filter()->set_mouse_warp_enabled(true);
shell->mouse_cursor_filter()->HideSharedEdgeIndicator();
if (instance_ == this)
@@ -126,7 +126,7 @@
// |mouse_warp_mode_| should be set to WARP_DRAG so that the user could move a
// window/tab to another display.
MouseCursorEventFilter* mouse_cursor_filter =
- Shell::GetInstance()->mouse_cursor_filter();
+ Shell::Get()->mouse_cursor_filter();
mouse_cursor_filter->set_mouse_warp_enabled(ShouldAllowMouseWarp());
if (ShouldAllowMouseWarp())
mouse_cursor_filter->ShowSharedEdgeIndicator(
diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc
index 410022bdf..565c2c1e 100644
--- a/ash/wm/drag_window_resizer_unittest.cc
+++ b/ash/wm/drag_window_resizer_unittest.cc
@@ -542,8 +542,7 @@
// Verifies if the resizer sets and resets
// MouseCursorEventFilter::mouse_warp_mode_ as expected.
TEST_F(DragWindowResizerTest, WarpMousePointer) {
- MouseCursorEventFilter* event_filter =
- Shell::GetInstance()->mouse_cursor_filter();
+ MouseCursorEventFilter* event_filter = Shell::Get()->mouse_cursor_filter();
ASSERT_TRUE(event_filter);
window_->SetBounds(gfx::Rect(0, 0, 50, 60));
@@ -592,8 +591,7 @@
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
ASSERT_EQ(2U, root_windows.size());
- test::CursorManagerTestApi cursor_test_api(
- Shell::GetInstance()->cursor_manager());
+ test::CursorManagerTestApi cursor_test_api(Shell::Get()->cursor_manager());
// Move window from the root window with 1.0 device scale factor to the root
// window with 2.0 device scale factor.
{
diff --git a/ash/wm/event_client_impl.cc b/ash/wm/event_client_impl.cc
index 69de5326..424d192 100644
--- a/ash/wm/event_client_impl.cc
+++ b/ash/wm/event_client_impl.cc
@@ -50,7 +50,7 @@
}
ui::EventTarget* EventClientImpl::GetToplevelEventTarget() {
- return Shell::GetInstance();
+ return Shell::Get();
}
} // namespace ash
diff --git a/ash/wm/immersive_fullscreen_controller_unittest.cc b/ash/wm/immersive_fullscreen_controller_unittest.cc
index 66fe12c..51f524e 100644
--- a/ash/wm/immersive_fullscreen_controller_unittest.cc
+++ b/ash/wm/immersive_fullscreen_controller_unittest.cc
@@ -515,7 +515,7 @@
// Set up initial state.
UpdateDisplay("800x600,800x600");
- ash::Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
+ ash::Shell::Get()->display_manager()->SetLayoutForCurrentDisplays(
display::test::CreateDisplayLayout(display_manager(),
display::DisplayPlacement::TOP, 0));
diff --git a/ash/wm/immersive_gesture_handler_aura.cc b/ash/wm/immersive_gesture_handler_aura.cc
index c157d661..7acc2ee 100644
--- a/ash/wm/immersive_gesture_handler_aura.cc
+++ b/ash/wm/immersive_gesture_handler_aura.cc
@@ -28,11 +28,11 @@
ImmersiveGestureHandlerAura::ImmersiveGestureHandlerAura(
ImmersiveFullscreenController* controller)
: immersive_fullscreen_controller_(controller) {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
}
ImmersiveGestureHandlerAura::~ImmersiveGestureHandlerAura() {
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
void ImmersiveGestureHandlerAura::OnGestureEvent(ui::GestureEvent* event) {
diff --git a/ash/wm/lock_state_controller.cc b/ash/wm/lock_state_controller.cc
index 36f083b..2a549d95 100644
--- a/ash/wm/lock_state_controller.cc
+++ b/ash/wm/lock_state_controller.cc
@@ -160,7 +160,7 @@
shutting_down_ = true;
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
// TODO(derat): Remove these null checks once mash instantiates a
// CursorManager.
if (shell->cursor_manager()) {
@@ -196,7 +196,7 @@
// This is also the case when the user signs off.
if (!shutting_down_) {
shutting_down_ = true;
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
if (shell->cursor_manager()) {
shell->cursor_manager()->HideCursor();
shell->cursor_manager()->LockCursor();
@@ -269,7 +269,7 @@
VLOG(1) << "OnPreShutdownAnimationTimeout";
shutting_down_ = true;
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
if (shell->cursor_manager())
shell->cursor_manager()->HideCursor();
@@ -285,7 +285,7 @@
}
base::TimeDelta sound_duration =
- Shell::GetInstance()->accessibility_delegate()->PlayShutdownSound();
+ Shell::Get()->accessibility_delegate()->PlayShutdownSound();
sound_duration =
std::min(sound_duration,
base::TimeDelta::FromMilliseconds(kMaxShutdownSoundDurationMs));
@@ -305,7 +305,7 @@
}
void LockStateController::StartCancellableShutdownAnimation() {
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
// Hide cursor, but let it reappear if the mouse moves.
if (shell->cursor_manager())
shell->cursor_manager()->HideCursor();
diff --git a/ash/wm/lock_state_controller_unittest.cc b/ash/wm/lock_state_controller_unittest.cc
index 5c18242..0a52e8a 100644
--- a/ash/wm/lock_state_controller_unittest.cc
+++ b/ash/wm/lock_state_controller_unittest.cc
@@ -36,7 +36,7 @@
namespace {
bool cursor_visible() {
- return Shell::GetInstance()->cursor_manager()->IsCursorVisible();
+ return Shell::Get()->cursor_manager()->IsCursorVisible();
}
void CheckCalledCallback(bool* flag) {
@@ -80,13 +80,13 @@
test_animator_ = new TestSessionStateAnimator;
- lock_state_controller_ = Shell::GetInstance()->lock_state_controller();
+ lock_state_controller_ = Shell::Get()->lock_state_controller();
lock_state_controller_->set_animator_for_test(test_animator_);
test_api_.reset(new LockStateControllerTestApi(lock_state_controller_));
test_api_->set_shutdown_controller(&test_shutdown_controller_);
- power_button_controller_ = Shell::GetInstance()->power_button_controller();
+ power_button_controller_ = Shell::Get()->power_button_controller();
shell_delegate_ =
static_cast<TestShellDelegate*>(Shell::Get()->shell_delegate());
diff --git a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
index 153f758..2bbd8a3 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
@@ -83,8 +83,7 @@
// Set the first display to be the internal display for the accelerometer
// screen rotation tests.
- display::test::DisplayManagerTestApi(
- Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetFirstDisplayAsInternalDisplay();
}
diff --git a/ash/wm/maximize_mode/maximize_mode_event_handler_aura.cc b/ash/wm/maximize_mode/maximize_mode_event_handler_aura.cc
index 749d249..35e5902 100644
--- a/ash/wm/maximize_mode/maximize_mode_event_handler_aura.cc
+++ b/ash/wm/maximize_mode/maximize_mode_event_handler_aura.cc
@@ -11,11 +11,11 @@
namespace wm {
MaximizeModeEventHandlerAura::MaximizeModeEventHandlerAura() {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
}
MaximizeModeEventHandlerAura::~MaximizeModeEventHandlerAura() {
- Shell::GetInstance()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(this);
}
void MaximizeModeEventHandlerAura::OnTouchEvent(ui::TouchEvent* event) {
diff --git a/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc
index 41f48491..3007324 100644
--- a/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc
+++ b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc
@@ -22,7 +22,7 @@
input_controller->IsInternalTouchpadEnabled()) {
should_ignore_touch_pad_ = false;
input_controller->SetInternalTouchpadEnabled(false);
- Shell::GetInstance()->cursor_manager()->HideCursor();
+ Shell::Get()->cursor_manager()->HideCursor();
}
// Allow the acccessible keys present on the side of some devices to continue
@@ -42,7 +42,7 @@
if (!should_ignore_touch_pad_) {
input_controller->SetInternalTouchpadEnabled(true);
- Shell::GetInstance()->cursor_manager()->ShowCursor();
+ Shell::Get()->cursor_manager()->ShowCursor();
}
input_controller->SetInternalKeyboardFilter(false /* enable_filter */,
diff --git a/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
index 8089766..cc7a99b490 100644
--- a/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
+++ b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
@@ -49,13 +49,13 @@
void SetMouseLocationInScreen(const gfx::Point& screen_location) {
const display::Display& display =
- Shell::GetInstance()->display_manager()->FindDisplayContainingPoint(
+ Shell::Get()->display_manager()->FindDisplayContainingPoint(
screen_location);
if (!display.is_valid())
return;
- aura::Window* root_window = Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display.id());
+ aura::Window* root_window =
+ Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display.id());
gfx::Point host_location(screen_location);
aura::client::ScreenPositionClient* client =
aura::client::GetScreenPositionClient(root_window);
@@ -88,7 +88,7 @@
// |touchpad_device_id_| will remain |kDeviceIdNone|.
touchpad_device_id_ = xi_dev_list[i].deviceid;
device_data_manager->DisableDevice(touchpad_device_id_);
- Shell::GetInstance()->cursor_manager()->HideCursor();
+ Shell::Get()->cursor_manager()->HideCursor();
}
} else if (device_name == kCoreKeyboardName) {
core_keyboard_device_id_ = xi_dev_list[i].deviceid;
@@ -123,7 +123,7 @@
ui::DeviceDataManager::GetInstance());
if (touchpad_device_id_ != kDeviceIdNone) {
device_data_manager->EnableDevice(touchpad_device_id_);
- Shell::GetInstance()->cursor_manager()->ShowCursor();
+ Shell::Get()->cursor_manager()->ShowCursor();
}
if (keyboard_device_id_ != kDeviceIdNone)
device_data_manager->EnableDevice(keyboard_device_id_);
diff --git a/ash/wm/overlay_event_filter_unittest.cc b/ash/wm/overlay_event_filter_unittest.cc
index 618e4d8..37a2294 100644
--- a/ash/wm/overlay_event_filter_unittest.cc
+++ b/ash/wm/overlay_event_filter_unittest.cc
@@ -20,15 +20,15 @@
TestOverlayDelegate d1;
TestOverlayDelegate d2;
- Shell::GetInstance()->overlay_filter()->Activate(&d1);
+ Shell::Get()->overlay_filter()->Activate(&d1);
EXPECT_EQ(0, d1.GetCancelCountAndReset());
EXPECT_EQ(0, d2.GetCancelCountAndReset());
- Shell::GetInstance()->overlay_filter()->Activate(&d2);
+ Shell::Get()->overlay_filter()->Activate(&d2);
EXPECT_EQ(1, d1.GetCancelCountAndReset());
EXPECT_EQ(0, d2.GetCancelCountAndReset());
- Shell::GetInstance()->overlay_filter()->Cancel();
+ Shell::Get()->overlay_filter()->Cancel();
EXPECT_EQ(0, d1.GetCancelCountAndReset());
EXPECT_EQ(1, d2.GetCancelCountAndReset());
}
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index 19ad95e..c90f08c 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -378,8 +378,7 @@
// Tests that an a11y alert is sent on entering overview mode.
TEST_F(WindowSelectorTest, A11yAlertOnOverviewMode) {
gfx::Rect bounds(0, 0, 400, 400);
- AccessibilityDelegate* delegate =
- Shell::GetInstance()->accessibility_delegate();
+ AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
std::unique_ptr<aura::Window> window1(CreateWindow(bounds));
EXPECT_NE(delegate->GetLastAccessibilityAlert(),
A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED);
@@ -1258,7 +1257,7 @@
bool drag_canceled_by_test = false;
gfx::Rect bounds(0, 0, 400, 400);
std::unique_ptr<aura::Window> window(CreateWindow(bounds));
- test::ShellTestApi shell_test_api(Shell::GetInstance());
+ test::ShellTestApi shell_test_api(Shell::Get());
DragDropController* drag_drop_controller =
shell_test_api.drag_drop_controller();
ui::OSExchangeData data;
@@ -1312,7 +1311,7 @@
if (WmShell::Get()->IsRunningInMash())
return;
- aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::Get()->GetPrimaryRootWindow();
UpdateDisplay("600x200");
EXPECT_EQ("0,0 600x200", root_window->bounds().ToString());
gfx::Rect window_bounds(0, 0, 150, 150);
@@ -1448,7 +1447,7 @@
return;
UpdateDisplay("400x400,400x400");
- Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
+ Shell::Get()->display_manager()->SetLayoutForCurrentDisplays(
display::test::CreateDisplayLayout(display_manager(),
display::DisplayPlacement::LEFT, 0));
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
diff --git a/ash/wm/panels/attached_panel_window_targeter.cc b/ash/wm/panels/attached_panel_window_targeter.cc
index 55845ea..0f458c5 100644
--- a/ash/wm/panels/attached_panel_window_targeter.cc
+++ b/ash/wm/panels/attached_panel_window_targeter.cc
@@ -23,11 +23,11 @@
panel_container_(container),
panel_layout_manager_(panel_layout_manager),
default_touch_extend_(default_touch_extend) {
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
AttachedPanelWindowTargeter::~AttachedPanelWindowTargeter() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void AttachedPanelWindowTargeter::OnShelfCreatedForRootWindow(
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index f20307a..43c9cf4 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -311,8 +311,7 @@
std::vector<display::ManagedDisplayInfo> info_list;
const int64_t internal_display_id =
- display::test::DisplayManagerTestApi(
- Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetFirstDisplayAsInternalDisplay();
// Create the primary display info.
@@ -348,8 +347,7 @@
std::vector<display::ManagedDisplayInfo> info_list;
const int64_t internal_display_id =
- display::test::DisplayManagerTestApi(
- Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetFirstDisplayAsInternalDisplay();
// Create the primary display info.
diff --git a/ash/wm/power_button_controller.cc b/ash/wm/power_button_controller.cc
index 8031ac50..c67c5e0e 100644
--- a/ash/wm/power_button_controller.cc
+++ b/ash/wm/power_button_controller.cc
@@ -43,13 +43,13 @@
tablet_controller_.reset(
new TabletPowerButtonController(lock_state_controller_));
}
- Shell::GetInstance()->display_configurator()->AddObserver(this);
- Shell::GetInstance()->PrependPreTargetHandler(this);
+ Shell::Get()->display_configurator()->AddObserver(this);
+ Shell::Get()->PrependPreTargetHandler(this);
}
PowerButtonController::~PowerButtonController() {
- Shell::GetInstance()->RemovePreTargetHandler(this);
- Shell::GetInstance()->display_configurator()->RemoveObserver(this);
+ Shell::Get()->RemovePreTargetHandler(this);
+ Shell::Get()->display_configurator()->RemoveObserver(this);
tablet_controller_.reset();
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(
this);
@@ -87,7 +87,7 @@
// Take screenshot on power button down plus volume down when in touch view.
if (should_take_screenshot) {
- SystemTray* system_tray = Shell::GetInstance()->GetPrimarySystemTray();
+ SystemTray* system_tray = Shell::Get()->GetPrimarySystemTray();
if (system_tray && system_tray->GetTrayAudio())
system_tray->GetTrayAudio()->HideDetailedView(false);
diff --git a/ash/wm/resize_shadow_and_cursor_unittest.cc b/ash/wm/resize_shadow_and_cursor_unittest.cc
index 96cce7a..3bc725cf 100644
--- a/ash/wm/resize_shadow_and_cursor_unittest.cc
+++ b/ash/wm/resize_shadow_and_cursor_unittest.cc
@@ -70,9 +70,8 @@
}
const ResizeShadow* GetShadow() const {
- return Shell::GetInstance()
- ->resize_shadow_controller()
- ->GetShadowForWindowForTest(window_);
+ return Shell::Get()->resize_shadow_controller()->GetShadowForWindowForTest(
+ window_);
}
// Returns the hit test code if there is a resize shadow. Returns HTNOWHERE if
@@ -101,7 +100,7 @@
// Returns the current cursor type.
int GetCurrentCursorType() const {
- CursorManagerTestApi test_api(ash::Shell::GetInstance()->cursor_manager());
+ CursorManagerTestApi test_api(ash::Shell::Get()->cursor_manager());
return test_api.GetCurrentCursor().native_type();
}
diff --git a/ash/wm/screen_pinning_controller.cc b/ash/wm/screen_pinning_controller.cc
index 9aa1cad7..a6e1df1 100644
--- a/ash/wm/screen_pinning_controller.cc
+++ b/ash/wm/screen_pinning_controller.cc
@@ -230,7 +230,7 @@
pinned_window_ = nullptr;
}
- Shell::GetInstance()->NotifyPinnedStateChanged(pinned_window);
+ Shell::Get()->NotifyPinnedStateChanged(pinned_window);
}
void ScreenPinningController::OnWindowAddedToPinnedContainer(
diff --git a/ash/wm/system_gesture_event_filter.cc b/ash/wm/system_gesture_event_filter.cc
index 41d43a9..9dcfd92 100644
--- a/ash/wm/system_gesture_event_filter.cc
+++ b/ash/wm/system_gesture_event_filter.cc
@@ -23,7 +23,7 @@
if (event->type() == ui::ET_MOUSE_PRESSED &&
ui::GetTouchScreensAvailability() ==
ui::TouchScreensAvailability::ENABLED) {
- Shell::GetInstance()->metrics()->RecordUserMetricsAction(UMA_MOUSE_DOWN);
+ Shell::Get()->metrics()->RecordUserMetricsAction(UMA_MOUSE_DOWN);
}
}
diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc
index 063cec1d..5b1a54c 100644
--- a/ash/wm/system_gesture_event_filter_unittest.cc
+++ b/ash/wm/system_gesture_event_filter_unittest.cc
@@ -128,8 +128,7 @@
test::AshTestBase::SetUp();
// Enable brightness key.
- display::test::DisplayManagerTestApi(
- Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(Shell::Get()->display_manager())
.SetFirstDisplayAsInternalDisplay();
}
diff --git a/ash/wm/video_detector.cc b/ash/wm/video_detector.cc
index 6a7779c1..d7a5f72 100644
--- a/ash/wm/video_detector.cc
+++ b/ash/wm/video_detector.cc
@@ -84,11 +84,11 @@
window_observer_manager_(this),
is_shutting_down_(false) {
aura::Env::GetInstance()->AddObserver(this);
- Shell::GetInstance()->AddShellObserver(this);
+ Shell::Get()->AddShellObserver(this);
}
VideoDetector::~VideoDetector() {
- Shell::GetInstance()->RemoveShellObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
aura::Env::GetInstance()->RemoveObserver(this);
}
diff --git a/ash/wm/video_detector_unittest.cc b/ash/wm/video_detector_unittest.cc
index 33a5c95..3343c06e 100644
--- a/ash/wm/video_detector_unittest.cc
+++ b/ash/wm/video_detector_unittest.cc
@@ -70,7 +70,7 @@
void SetUp() override {
AshTestBase::SetUp();
observer_.reset(new TestObserver);
- detector_ = Shell::GetInstance()->video_detector();
+ detector_ = Shell::Get()->video_detector();
detector_->AddObserver(observer_.get());
now_ = base::TimeTicks::Now();
@@ -198,7 +198,7 @@
TEST_F(VideoDetectorTest, DontReportDuringShutdown) {
std::unique_ptr<aura::Window> window =
CreateTestWindow(gfx::Rect(0, 0, 1024, 768));
- Shell::GetInstance()->OnAppTerminating();
+ Shell::Get()->OnAppTerminating();
SendUpdates(window.get(), kMinRect, kMinFps + 5, 2 * kMinDuration);
EXPECT_TRUE(observer_->empty());
}
diff --git a/ash/wm/window_cycle_event_filter_aura.cc b/ash/wm/window_cycle_event_filter_aura.cc
index d77397a..4f2d0fd 100644
--- a/ash/wm/window_cycle_event_filter_aura.cc
+++ b/ash/wm/window_cycle_event_filter_aura.cc
@@ -13,17 +13,17 @@
namespace ash {
WindowCycleEventFilterAura::WindowCycleEventFilterAura() {
- Shell::GetInstance()->AddPreTargetHandler(this);
+ Shell::Get()->AddPreTargetHandler(this);
// Handling release of "Alt" must come before other pretarget handlers
// (specifically, the partial screenshot handler). See crbug.com/651939
// We can't do all key event handling that early though because it prevents
// other accelerators (like triggering a partial screenshot) from working.
- Shell::GetInstance()->PrependPreTargetHandler(&alt_release_handler_);
+ Shell::Get()->PrependPreTargetHandler(&alt_release_handler_);
}
WindowCycleEventFilterAura::~WindowCycleEventFilterAura() {
- Shell::GetInstance()->RemovePreTargetHandler(this);
- Shell::GetInstance()->RemovePreTargetHandler(&alt_release_handler_);
+ Shell::Get()->RemovePreTargetHandler(this);
+ Shell::Get()->RemovePreTargetHandler(&alt_release_handler_);
}
void WindowCycleEventFilterAura::OnKeyEvent(ui::KeyEvent* event) {
diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc
index 7d4936ca..4008f83 100644
--- a/ash/wm/window_manager_unittest.cc
+++ b/ash/wm/window_manager_unittest.cc
@@ -643,7 +643,7 @@
std::unique_ptr<CustomEventHandler> f2(new CustomEventHandler);
// Adds them to root window event filter.
- ::wm::CompoundEventFilter* env_filter = Shell::GetInstance()->env_filter();
+ ::wm::CompoundEventFilter* env_filter = Shell::Get()->env_filter();
env_filter->AddHandler(f1.get());
env_filter->AddHandler(f2.get());
@@ -712,8 +712,7 @@
return;
ui::test::EventGenerator& generator = GetEventGenerator();
- ::wm::CursorManager* cursor_manager =
- ash::Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = ash::Shell::Get()->cursor_manager();
generator.MoveMouseTo(gfx::Point(0, 0));
EXPECT_TRUE(cursor_manager->IsCursorVisible());
@@ -736,8 +735,7 @@
return;
ui::test::EventGenerator& generator = GetEventGenerator();
- ::wm::CursorManager* cursor_manager =
- ash::Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = ash::Shell::Get()->cursor_manager();
// Pressing a key hides the cursor but does not disable mouse events.
generator.PressKey(ui::VKEY_A, ui::EF_NONE);
@@ -761,7 +759,7 @@
return;
ui::test::EventGenerator& generator = GetEventGenerator();
- ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager();
ASSERT_TRUE(cursor_manager->IsCursorVisible());
@@ -786,8 +784,7 @@
return;
ui::test::EventGenerator& generator = GetEventGenerator();
- ::wm::CursorManager* cursor_manager =
- ash::Shell::GetInstance()->cursor_manager();
+ ::wm::CursorManager* cursor_manager = ash::Shell::Get()->cursor_manager();
std::unique_ptr<aura::Window> w1(
CreateTestWindowInShell(SK_ColorWHITE, -1, gfx::Rect(0, 0, 100, 100)));
diff --git a/ash/wm/workspace/multi_window_resize_controller_unittest.cc b/ash/wm/workspace/multi_window_resize_controller_unittest.cc
index 6fd0a13..f68d47baa 100644
--- a/ash/wm/workspace/multi_window_resize_controller_unittest.cc
+++ b/ash/wm/workspace/multi_window_resize_controller_unittest.cc
@@ -55,7 +55,7 @@
void SetUp() override {
test::AshTestBase::SetUp();
WorkspaceController* wc =
- test::ShellTestApi(Shell::GetInstance()).workspace_controller();
+ test::ShellTestApi(Shell::Get()).workspace_controller();
WorkspaceEventHandler* event_handler =
WorkspaceControllerTestHelper(wc).GetEventHandler();
resize_controller_ =
diff --git a/ash/wm/workspace/workspace_layout_manager_keyboard_unittest.cc b/ash/wm/workspace/workspace_layout_manager_keyboard_unittest.cc
index d19b6718..8122f5f 100644
--- a/ash/wm/workspace/workspace_layout_manager_keyboard_unittest.cc
+++ b/ash/wm/workspace/workspace_layout_manager_keyboard_unittest.cc
@@ -105,7 +105,7 @@
TEST_F(WorkspaceLayoutManagerKeyboardTest, ChangeWorkAreaInNonStickyMode) {
keyboard::SetAccessibilityKeyboardEnabled(true);
InitKeyboardBounds();
- Shell::GetInstance()->CreateKeyboard();
+ Shell::Get()->CreateKeyboard();
keyboard::KeyboardController* kb_controller =
keyboard::KeyboardController::GetInstance();
@@ -158,7 +158,7 @@
keyboard::SetAccessibilityKeyboardEnabled(true);
InitKeyboardBounds();
- Shell::GetInstance()->CreateKeyboard();
+ Shell::Get()->CreateKeyboard();
keyboard::KeyboardController* kb_controller =
keyboard::KeyboardController::GetInstance();
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index 9953da1b..1ee01407 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -80,7 +80,7 @@
aura::Window* root = Shell::GetPrimaryRootWindow();
gfx::Rect root_bounds(root->bounds());
EXPECT_EQ(800, root_bounds.width());
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
window_.reset(new aura::Window(&delegate_));
window_->SetType(ui::wm::WINDOW_TYPE_NORMAL);
window_->Init(ui::LAYER_NOT_DRAWN);
@@ -418,7 +418,7 @@
TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_3) {
UpdateDisplay("600x800");
aura::Window* root = Shell::GetPrimaryRootWindow();
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
window_->SetBounds(gfx::Rect(300, 100, 300, 200));
window2_->SetBounds(gfx::Rect(300, 300, 200, 150));
@@ -504,7 +504,7 @@
window_->SetBounds(gfx::Rect(0, 300, 400, 300));
window2_->SetBounds(gfx::Rect(400, 200, 100, 200));
- Shell* shell = Shell::GetInstance();
+ Shell* shell = Shell::Get();
ui::test::EventGenerator generator(window_->GetRootWindow());
// The cursor should not be locked initially.
@@ -782,8 +782,8 @@
// Makes sure we don't allow dragging below the work area.
TEST_F(WorkspaceWindowResizerTest, DontDragOffBottom) {
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(0, 0, 10, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(0, 0, 10, 0));
ASSERT_EQ(1, display::Screen::GetScreen()->GetNumDisplays());
@@ -808,11 +808,11 @@
UpdateDisplay("800x600,800x600");
ASSERT_EQ(2, display::Screen::GetScreen()->GetNumDisplays());
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(0, 0, 10, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(0, 0, 10, 0));
// Positions the secondary display at the bottom the primary display.
- Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
+ Shell::Get()->display_manager()->SetLayoutForCurrentDisplays(
display::test::CreateDisplayLayout(display_manager(),
display::DisplayPlacement::BOTTOM, 0));
@@ -835,8 +835,8 @@
resizer->RevertDrag();
}
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(0, 0, 10, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(0, 0, 10, 0));
{
window_->SetBounds(gfx::Rect(100, 200, 300, 400));
std::unique_ptr<WindowResizer> resizer(
@@ -869,8 +869,8 @@
// Makes sure we don't allow dragging off the top of the work area.
TEST_F(WorkspaceWindowResizerTest, DontDragOffTop) {
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(10, 0, 0, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(10, 0, 0, 0));
window_->SetBounds(gfx::Rect(100, 200, 300, 400));
std::unique_ptr<WindowResizer> resizer(
@@ -881,8 +881,8 @@
}
TEST_F(WorkspaceWindowResizerTest, ResizeBottomOutsideWorkArea) {
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(0, 0, 50, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(0, 0, 50, 0));
window_->SetBounds(gfx::Rect(100, 200, 300, 380));
std::unique_ptr<WindowResizer> resizer(
@@ -893,8 +893,8 @@
}
TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideLeftWorkArea) {
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(0, 0, 50, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(0, 0, 50, 0));
int left = ScreenUtil::GetDisplayWorkAreaBoundsInParent(window_.get()).x();
int pixels_to_left_border = 50;
int window_width = 300;
@@ -910,8 +910,8 @@
}
TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideRightWorkArea) {
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(0, 0, 50, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(0, 0, 50, 0));
int right =
ScreenUtil::GetDisplayWorkAreaBoundsInParent(window_.get()).right();
int pixels_to_right_border = 50;
@@ -930,8 +930,8 @@
}
TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideBottomWorkArea) {
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(0, 0, 50, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(0, 0, 50, 0));
int bottom =
ScreenUtil::GetDisplayWorkAreaBoundsInParent(window_.get()).bottom();
int delta_to_bottom = 50;
@@ -953,8 +953,8 @@
TEST_F(WorkspaceWindowResizerTest, DragWindowOutsideRightToSecondaryDisplay) {
// Only primary display. Changes the window position to fit within the
// display.
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(0, 0, 50, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(0, 0, 50, 0));
int right =
ScreenUtil::GetDisplayWorkAreaBoundsInParent(window_.get()).right();
int pixels_to_right_border = 50;
@@ -972,8 +972,8 @@
// With secondary display. Operation itself is same but doesn't change
// the position because the window is still within the secondary display.
UpdateDisplay("1000x600,600x400");
- Shell::GetInstance()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
- gfx::Insets(0, 0, 50, 0));
+ Shell::Get()->SetDisplayWorkAreaInsets(Shell::GetPrimaryRootWindow(),
+ gfx::Insets(0, 0, 50, 0));
window_->SetBounds(gfx::Rect(window_x, 100, window_width, 380));
resizer->Drag(CalculateDragPoint(*resizer, window_width, 0), 0);
EXPECT_EQ(base::IntToString(window_x + window_width) + ",100 " +
@@ -1528,7 +1528,7 @@
TEST_F(WorkspaceWindowResizerTest, DontRewardRightmostWindowForOverflows) {
UpdateDisplay("600x800");
aura::Window* root = Shell::GetPrimaryRootWindow();
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Four 100x100 windows flush against eachother, starting at 100,100.
window_->SetBounds(gfx::Rect(100, 100, 100, 100));
@@ -1559,7 +1559,7 @@
TEST_F(WorkspaceWindowResizerTest, DontExceedMaxWidth) {
UpdateDisplay("600x800");
aura::Window* root = Shell::GetPrimaryRootWindow();
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Four 100x100 windows flush against eachother, starting at 100,100.
window_->SetBounds(gfx::Rect(100, 100, 100, 100));
@@ -1588,7 +1588,7 @@
TEST_F(WorkspaceWindowResizerTest, DontExceedMaxHeight) {
UpdateDisplay("600x800");
aura::Window* root = Shell::GetPrimaryRootWindow();
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Four 100x100 windows flush against eachother, starting at 100,100.
window_->SetBounds(gfx::Rect(100, 100, 100, 100));
@@ -1617,7 +1617,7 @@
TEST_F(WorkspaceWindowResizerTest, DontExceedMinHeight) {
UpdateDisplay("600x500");
aura::Window* root = Shell::GetPrimaryRootWindow();
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Four 100x100 windows flush against eachother, starting at 100,100.
window_->SetBounds(gfx::Rect(100, 100, 100, 100));
@@ -1646,7 +1646,7 @@
TEST_F(WorkspaceWindowResizerTest, DontExpandRightmostPastMaxWidth) {
UpdateDisplay("600x800");
aura::Window* root = Shell::GetPrimaryRootWindow();
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Three 100x100 windows flush against eachother, starting at 100,100.
window_->SetBounds(gfx::Rect(100, 100, 100, 100));
@@ -1672,7 +1672,7 @@
TEST_F(WorkspaceWindowResizerTest, MoveAttachedWhenGrownToMaxSize) {
UpdateDisplay("600x800");
aura::Window* root = Shell::GetPrimaryRootWindow();
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Three 100x100 windows flush against eachother, starting at 100,100.
window_->SetBounds(gfx::Rect(100, 100, 100, 100));
@@ -1699,7 +1699,7 @@
TEST_F(WorkspaceWindowResizerTest, MainWindowHonoursMaxWidth) {
UpdateDisplay("400x800");
aura::Window* root = Shell::GetPrimaryRootWindow();
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Three 100x100 windows flush against eachother, starting at 100,100.
window_->SetBounds(gfx::Rect(100, 100, 100, 100));
@@ -1726,7 +1726,7 @@
TEST_F(WorkspaceWindowResizerTest, MainWindowHonoursMinWidth) {
UpdateDisplay("400x800");
aura::Window* root = Shell::GetPrimaryRootWindow();
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets());
+ Shell::Get()->SetDisplayWorkAreaInsets(root, gfx::Insets());
// Three 100x100 windows flush against eachother, starting at 100,100.
window_->SetBounds(gfx::Rect(100, 100, 100, 100));
diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc
index 9011354e..70e99f7 100644
--- a/ash/wm/workspace_controller_unittest.cc
+++ b/ash/wm/workspace_controller_unittest.cc
@@ -624,7 +624,7 @@
gfx::Insets insets =
display::Screen::GetScreen()->GetPrimaryDisplay().GetWorkAreaInsets();
insets.Set(0, 0, insets.bottom() + 30, 0);
- Shell::GetInstance()->SetDisplayWorkAreaInsets(w1.get(), insets);
+ Shell::Get()->SetDisplayWorkAreaInsets(w1.get(), insets);
// Switch to w1. The window should have moved.
wm::ActivateWindow(w1.get());
@@ -700,8 +700,7 @@
// Window with a transient parent. We set the transient parent to the root,
// which would never happen but is enough to exercise the bug.
std::unique_ptr<Window> w1(CreateTestWindowUnparented());
- ::wm::AddTransientChild(Shell::GetInstance()->GetPrimaryRootWindow(),
- w1.get());
+ ::wm::AddTransientChild(Shell::Get()->GetPrimaryRootWindow(), w1.get());
w1->SetBounds(gfx::Rect(10, 11, 250, 251));
ParentWindowInPrimaryRootWindow(w1.get());
w1->Show();
diff --git a/chrome/browser/chromeos/accessibility/accessibility_highlight_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_highlight_manager.cc
index 90024dc5..15ef6cf 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_highlight_manager.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_highlight_manager.cc
@@ -38,7 +38,7 @@
AccessibilityFocusRingController::GetInstance()->HideCaretRing();
AccessibilityFocusRingController::GetInstance()->HideCursorRing();
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
if (shell && registered_observers_) {
shell->RemovePreTargetHandler(this);
shell->cursor_manager()->RemoveObserver(this);
@@ -65,7 +65,7 @@
}
void AccessibilityHighlightManager::RegisterObservers() {
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
shell->AddPreTargetHandler(this);
shell->cursor_manager()->AddObserver(this);
registrar_.Add(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
@@ -131,7 +131,7 @@
}
bool AccessibilityHighlightManager::IsCursorVisible() {
- return ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible();
+ return ash::Shell::Get()->cursor_manager()->IsCursorVisible();
}
void AccessibilityHighlightManager::UpdateFocusAndCaretHighlights() {
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
index 0052d3c..df35212 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -416,10 +416,10 @@
NotifyAccessibilityStatusChanged(details);
- ash::Shell::GetInstance()->cursor_manager()->SetCursorSet(
+ ash::Shell::Get()->cursor_manager()->SetCursorSet(
enabled ? ui::CURSOR_SET_LARGE : ui::CURSOR_SET_NORMAL);
- ash::Shell::GetInstance()->SetLargeCursorSizeInDip(large_cursor_size_in_dip);
- ash::Shell::GetInstance()->SetCursorCompositingEnabled(
+ ash::Shell::Get()->SetLargeCursorSizeInDip(large_cursor_size_in_dip);
+ ash::Shell::Get()->SetCursorCompositingEnabled(
ShouldEnableCursorCompositing());
}
@@ -457,7 +457,7 @@
return;
sticky_keys_enabled_ = enabled;
- ash::Shell::GetInstance()->sticky_keys_controller()->Enable(enabled);
+ ash::Shell::Get()->sticky_keys_controller()->Enable(enabled);
}
void AccessibilityManager::EnableSpokenFeedback(
@@ -552,8 +552,8 @@
NotifyAccessibilityStatusChanged(details);
- ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled(enabled);
- ash::Shell::GetInstance()->SetCursorCompositingEnabled(
+ ash::Shell::Get()->high_contrast_controller()->SetEnabled(enabled);
+ ash::Shell::Get()->SetCursorCompositingEnabled(
ShouldEnableCursorCompositing());
}
@@ -683,7 +683,7 @@
return;
}
- ash::Shell::GetInstance()->autoclick_controller()->SetEnabled(enabled);
+ ash::Shell::Get()->autoclick_controller()->SetEnabled(enabled);
}
void AccessibilityManager::SetAutoclickDelay(int delay_ms) {
@@ -721,7 +721,7 @@
return;
}
- ash::Shell::GetInstance()->autoclick_controller()->SetAutoclickDelay(
+ ash::Shell::Get()->autoclick_controller()->SetAutoclickDelay(
autoclick_delay_ms_);
}
@@ -760,9 +760,9 @@
// might still be enabled and a forced reset is required to pick up the
// layout change.
if (keyboard::IsKeyboardEnabled())
- ash::Shell::GetInstance()->CreateKeyboard();
+ ash::Shell::Get()->CreateKeyboard();
else
- ash::Shell::GetInstance()->DeactivateKeyboard();
+ ash::Shell::Get()->DeactivateKeyboard();
} else {
// TODO(mash): Support on-screen keyboard. See http://crbug.com/646565
NOTIMPLEMENTED();
@@ -802,7 +802,7 @@
enabled, ash::A11Y_NOTIFICATION_NONE);
NotifyAccessibilityStatusChanged(details);
- ash::Shell::GetInstance()->audio_a11y_controller()->SetOutputMono(enabled);
+ ash::Shell::Get()->audio_a11y_controller()->SetOutputMono(enabled);
}
void AccessibilityManager::SetCaretHighlightEnabled(bool enabled) {
@@ -1044,7 +1044,7 @@
// Sticky keys is implemented only in ash.
// TODO(dpolukhin): support Athena, crbug.com/408733.
if (!ash_util::IsRunningInMash()) {
- ash::Shell::GetInstance()->sticky_keys_controller()->SetModifiersEnabled(
+ ash::Shell::Get()->sticky_keys_controller()->SetModifiersEnabled(
manager->IsISOLevel5ShiftUsedByCurrentInputMethod(),
manager->IsAltGrUsedByCurrentInputMethod());
}
diff --git a/chrome/browser/chromeos/accessibility/magnification_controller_browsertest.cc b/chrome/browser/chromeos/accessibility/magnification_controller_browsertest.cc
index 62230e7b5..da4db5c 100644
--- a/chrome/browser/chromeos/accessibility/magnification_controller_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/magnification_controller_browsertest.cc
@@ -45,7 +45,7 @@
}
ash::MagnificationController* GetMagnificationController() {
- return ash::Shell::GetInstance()->magnification_controller();
+ return ash::Shell::Get()->magnification_controller();
}
bool IsMagnifierEnabled() {
diff --git a/chrome/browser/chromeos/accessibility/magnification_manager.cc b/chrome/browser/chromeos/accessibility/magnification_manager.cc
index 60b53ba..7b19e03 100644
--- a/chrome/browser/chromeos/accessibility/magnification_manager.cc
+++ b/chrome/browser/chromeos/accessibility/magnification_manager.cc
@@ -154,11 +154,10 @@
enabled_ = enabled;
if (type_ == ash::MAGNIFIER_FULL) {
- ash::Shell::GetInstance()->magnification_controller()->SetEnabled(
- enabled_);
+ ash::Shell::Get()->magnification_controller()->SetEnabled(enabled_);
MonitorFocusInPageChange();
} else {
- ash::Shell::GetInstance()->partial_magnification_controller()->SetEnabled(
+ ash::Shell::Get()->partial_magnification_controller()->SetEnabled(
enabled_);
}
}
@@ -177,9 +176,8 @@
keep_focus_centered_ = keep_focus_centered;
if (type_ == ash::MAGNIFIER_FULL) {
- ash::Shell::GetInstance()
- ->magnification_controller()
- ->SetKeepFocusCentered(keep_focus_centered_);
+ ash::Shell::Get()->magnification_controller()->SetKeepFocusCentered(
+ keep_focus_centered_);
}
}
@@ -221,8 +219,8 @@
if (AccessibilityManager::Get()) {
AccessibilityManager::Get()->NotifyAccessibilityStatusChanged(details);
- if (ash::Shell::GetInstance()) {
- ash::Shell::GetInstance()->SetCursorCompositingEnabled(
+ if (ash::Shell::Get()) {
+ ash::Shell::Get()->SetCursorCompositingEnabled(
AccessibilityManager::Get()->ShouldEnableCursorCompositing());
}
}
@@ -271,10 +269,9 @@
case content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE: {
content::FocusedNodeDetails* node_details =
content::Details<content::FocusedNodeDetails>(details).ptr();
- ash::Shell::GetInstance()
- ->magnification_controller()
- ->HandleFocusedNodeChanged(node_details->is_editable_node,
- node_details->node_bounds_in_screen);
+ ash::Shell::Get()->magnification_controller()->HandleFocusedNodeChanged(
+ node_details->is_editable_node,
+ node_details->node_bounds_in_screen);
break;
}
}
diff --git a/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc b/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc
index 77f9eec..b057f6c 100644
--- a/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc
@@ -43,12 +43,11 @@
}
void SetFullScreenMagnifierScale(double scale) {
- ash::Shell::GetInstance()->
- magnification_controller()->SetScale(scale, false);
+ ash::Shell::Get()->magnification_controller()->SetScale(scale, false);
}
double GetFullScreenMagnifierScale() {
- return ash::Shell::GetInstance()->magnification_controller()->GetScale();
+ return ash::Shell::Get()->magnification_controller()->GetScale();
}
void SetSavedFullScreenMagnifierScale(double scale) {
diff --git a/chrome/browser/chromeos/accessibility/select_to_speak_browsertest.cc b/chrome/browser/chromeos/accessibility/select_to_speak_browsertest.cc
index 8910da96..06826fe7 100644
--- a/chrome/browser/chromeos/accessibility/select_to_speak_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/select_to_speak_browsertest.cc
@@ -33,8 +33,7 @@
AccessibilityManager::Get()->SetSelectToSpeakEnabled(true);
extension_load_waiter.Wait();
- aura::Window* root_window =
- ash::Shell::GetInstance()->GetPrimaryRootWindow();
+ aura::Window* root_window = ash::Shell::Get()->GetPrimaryRootWindow();
generator_.reset(new ui::test::EventGenerator(root_window));
ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL));
@@ -47,7 +46,7 @@
};
IN_PROC_BROWSER_TEST_F(SelectToSpeakTest, SpeakStatusTray) {
- ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
+ ash::SystemTray* tray = ash::Shell::Get()->GetPrimarySystemTray();
gfx::Rect tray_bounds = tray->GetBoundsInScreen();
// Hold down Search and click a few pixels into the status tray bounds.
diff --git a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler.cc b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler.cc
index 4bc5f68..b9b9ba15 100644
--- a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler.cc
+++ b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler.cc
@@ -19,17 +19,13 @@
namespace chromeos {
SelectToSpeakEventHandler::SelectToSpeakEventHandler() {
- if (ash::Shell::HasInstance()) {
- ash::Shell::GetInstance()->GetPrimaryRootWindow()->AddPreTargetHandler(
- this);
- }
+ if (ash::Shell::HasInstance())
+ ash::Shell::Get()->GetPrimaryRootWindow()->AddPreTargetHandler(this);
}
SelectToSpeakEventHandler::~SelectToSpeakEventHandler() {
- if (ash::Shell::HasInstance()) {
- ash::Shell::GetInstance()->GetPrimaryRootWindow()->RemovePreTargetHandler(
- this);
- }
+ if (ash::Shell::HasInstance())
+ ash::Shell::Get()->GetPrimaryRootWindow()->RemovePreTargetHandler(this);
}
void SelectToSpeakEventHandler::OnKeyEvent(ui::KeyEvent* event) {
diff --git a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
index adb9ea21..1fb05aac 100644
--- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
@@ -614,7 +614,7 @@
// Send an accessibility hover event on the system tray, which is
// what we get when you tap it on a touch screen when ChromeVox is on.
- ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
+ ash::SystemTray* tray = ash::Shell::Get()->GetPrimarySystemTray();
tray->NotifyAccessibilityEvent(ui::AX_EVENT_HOVER, true);
EXPECT_EQ("Status tray,", speech_monitor_.GetNextUtterance());
diff --git a/chrome/browser/chromeos/accessibility/sticky_keys_browsertest.cc b/chrome/browser/chromeos/accessibility/sticky_keys_browsertest.cc
index 5b33159..cf5e0fb 100644
--- a/chrome/browser/chromeos/accessibility/sticky_keys_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/sticky_keys_browsertest.cc
@@ -51,7 +51,7 @@
}
ash::SystemTray* GetSystemTray() {
- return ash::Shell::GetInstance()->GetPrimarySystemTray();
+ return ash::Shell::Get()->GetPrimarySystemTray();
}
void SendKeyPress(ui::KeyboardCode key) {
@@ -201,7 +201,7 @@
// Overlay should not be visible if sticky keys is not enabled.
ash::StickyKeysController* controller =
- ash::Shell::GetInstance()->sticky_keys_controller();
+ ash::Shell::Get()->sticky_keys_controller();
EXPECT_FALSE(controller->GetOverlayForTest());
for (auto key_code : modifier_keys) {
SendKeyPress(key_code);
diff --git a/chrome/browser/chromeos/accessibility/switch_access_event_handler.cc b/chrome/browser/chromeos/accessibility/switch_access_event_handler.cc
index a6c4ce0..3f01698 100644
--- a/chrome/browser/chromeos/accessibility/switch_access_event_handler.cc
+++ b/chrome/browser/chromeos/accessibility/switch_access_event_handler.cc
@@ -16,12 +16,12 @@
SwitchAccessEventHandler::SwitchAccessEventHandler() {
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->AddPreTargetHandler(this);
+ ash::Shell::Get()->AddPreTargetHandler(this);
}
SwitchAccessEventHandler::~SwitchAccessEventHandler() {
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->RemovePreTargetHandler(this);
+ ash::Shell::Get()->RemovePreTargetHandler(this);
}
void SwitchAccessEventHandler::OnKeyEvent(ui::KeyEvent* event) {
diff --git a/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc b/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
index 72265e4..9e45716 100644
--- a/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
@@ -46,7 +46,7 @@
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
content::WaitForResizeComplete(web_contents);
- root_window_ = ash::Shell::GetInstance()->GetPrimaryRootWindow();
+ root_window_ = ash::Shell::Get()->GetPrimaryRootWindow();
event_handler_.reset(new ui::test::TestEventHandler());
root_window_->AddPreTargetHandler(event_handler_.get());
}
@@ -58,7 +58,7 @@
void SwitchTouchExplorationMode(bool on) {
ash::AccessibilityDelegate* delegate =
- ash::Shell::GetInstance()->accessibility_delegate();
+ ash::Shell::Get()->accessibility_delegate();
if (on != delegate->IsSpokenFeedbackEnabled())
delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE);
}
diff --git a/chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc b/chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc
index c9342ea..884e97d3 100644
--- a/chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc
+++ b/chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc
@@ -52,13 +52,13 @@
} // namespace
ArcInstanceThrottle::ArcInstanceThrottle() {
- ash::Shell::GetInstance()->activation_client()->AddObserver(this);
+ ash::Shell::Get()->activation_client()->AddObserver(this);
ThrottleInstanceIfNeeded(ash::WmWindow::Get(ash::wm::GetActiveWindow()));
}
ArcInstanceThrottle::~ArcInstanceThrottle() {
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ ash::Shell::Get()->activation_client()->RemoveObserver(this);
}
void ArcInstanceThrottle::OnWindowActivated(ActivationReason reason,
diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
index 081b7ca7..99772a1 100644
--- a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
+++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
@@ -95,7 +95,7 @@
const CaptureFocusedWindowCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
aura::Window* window =
- ash::Shell::GetInstance()->activation_client()->GetActiveWindow();
+ ash::Shell::Get()->activation_client()->GetActiveWindow();
if (window == nullptr) {
callback.Run(std::vector<uint8_t>{});
diff --git a/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc b/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc
index b0ec1fa..88d427b8 100644
--- a/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc
+++ b/chrome/browser/chromeos/arc/wallpaper/arc_wallpaper_service.cc
@@ -58,7 +58,7 @@
ash::WallpaperController* GetWallpaperController() {
if (!ash::Shell::HasInstance())
return nullptr;
- return ash::Shell::GetInstance()->wallpaper_controller();
+ return ash::Shell::Get()->wallpaper_controller();
}
} // namespace
@@ -218,8 +218,7 @@
void ArcWallpaperService::GetWallpaper(const GetWallpaperCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- ash::WallpaperController* wc =
- ash::Shell::GetInstance()->wallpaper_controller();
+ ash::WallpaperController* wc = ash::Shell::Get()->wallpaper_controller();
gfx::ImageSkia wallpaper = wc->GetWallpaper();
base::PostTaskWithTraitsAndReplyWithResult(
FROM_HERE, base::TaskTraits().MayBlock().WithPriority(
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
index 7864344..0d3b565 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -806,7 +806,7 @@
keyboard_event_rewriters_->AddEventRewriter(
base::MakeUnique<ui::EventRewriterChromeOS>(
event_rewriter_delegate_.get(),
- ash::Shell::GetInstance()->sticky_keys_controller()));
+ ash::Shell::Get()->sticky_keys_controller()));
keyboard_event_rewriters_->Init();
}
diff --git a/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc b/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc
index 92da2c0a..f94b0e3 100644
--- a/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc
+++ b/chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc
@@ -250,7 +250,7 @@
WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId());
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
- ash::Shell::GetInstance()->wallpaper_controller()->GetWallpaper(),
+ ash::Shell::Get()->wallpaper_controller()->GetWallpaper(),
wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
WallpaperImageFetcherFactory url_factory(
@@ -268,7 +268,7 @@
observer.WaitForWallpaperAnimationFinished();
EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
- ash::Shell::GetInstance()->wallpaper_controller()->GetWallpaper(),
+ ash::Shell::Get()->wallpaper_controller()->GetWallpaper(),
wallpaper_manager_test_utils::kCustomWallpaperColor));
EXPECT_EQ(1U, url_factory.num_attempts());
}
@@ -279,7 +279,7 @@
WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId());
wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
- ash::Shell::GetInstance()->wallpaper_controller()->GetWallpaper(),
+ ash::Shell::Get()->wallpaper_controller()->GetWallpaper(),
wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
WallpaperImageFetcherFactory url_factory(
@@ -297,7 +297,7 @@
observer.WaitForWallpaperAnimationFinished();
EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
- ash::Shell::GetInstance()->wallpaper_controller()->GetWallpaper(),
+ ash::Shell::Get()->wallpaper_controller()->GetWallpaper(),
wallpaper_manager_test_utils::kCustomWallpaperColor));
EXPECT_EQ(2U, url_factory.num_attempts());
diff --git a/chrome/browser/chromeos/dbus/chrome_console_service_provider_delegate.cc b/chrome/browser/chromeos/dbus/chrome_console_service_provider_delegate.cc
index 4b10e5e5..d1340371 100644
--- a/chrome/browser/chromeos/dbus/chrome_console_service_provider_delegate.cc
+++ b/chrome/browser/chromeos/dbus/chrome_console_service_provider_delegate.cc
@@ -17,13 +17,12 @@
void ChromeConsoleServiceProviderDelegate::TakeDisplayOwnership(
const UpdateOwnershipCallback& callback) {
- ash::Shell::GetInstance()->display_configurator()->TakeControl(callback);
+ ash::Shell::Get()->display_configurator()->TakeControl(callback);
}
void ChromeConsoleServiceProviderDelegate::ReleaseDisplayOwnership(
const UpdateOwnershipCallback& callback) {
- ash::Shell::GetInstance()->display_configurator()->RelinquishControl(
- callback);
+ ash::Shell::Get()->display_configurator()->RelinquishControl(callback);
}
} // namespace chromeos
diff --git a/chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.cc b/chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.cc
index 5ab6c10c..6f709eb 100644
--- a/chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.cc
+++ b/chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.cc
@@ -29,7 +29,7 @@
// know so that it can ignore such events.
ui::UserActivityDetector::Get()->OnDisplayPowerChanging();
- ash::Shell::GetInstance()->display_configurator()->SetDisplayPower(
+ ash::Shell::Get()->display_configurator()->SetDisplayPower(
power_state, display::DisplayConfigurator::kSetDisplayPowerNoFlags,
callback);
}
diff --git a/chrome/browser/chromeos/display/display_configuration_observer.cc b/chrome/browser/chromeos/display/display_configuration_observer.cc
index 5e36c434..e100174 100644
--- a/chrome/browser/chromeos/display/display_configuration_observer.cc
+++ b/chrome/browser/chromeos/display/display_configuration_observer.cc
@@ -13,11 +13,11 @@
namespace chromeos {
DisplayConfigurationObserver::DisplayConfigurationObserver() {
- ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->AddObserver(this);
}
DisplayConfigurationObserver::~DisplayConfigurationObserver() {
- ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
}
void DisplayConfigurationObserver::OnDisplaysInitialized() {
diff --git a/chrome/browser/chromeos/display/display_preferences.cc b/chrome/browser/chromeos/display/display_preferences.cc
index 914b7ac..c617525 100644
--- a/chrome/browser/chromeos/display/display_preferences.cc
+++ b/chrome/browser/chromeos/display/display_preferences.cc
@@ -183,7 +183,7 @@
}
display::DisplayManager* GetDisplayManager() {
- return ash::Shell::GetInstance()->display_manager();
+ return ash::Shell::Get()->display_manager();
}
// Returns true id the current user can write display preferences to
@@ -410,13 +410,13 @@
void StoreCurrentDisplayPowerState() {
StoreDisplayPowerState(
- ash::Shell::GetInstance()->display_configurator()->
- requested_power_state());
+ ash::Shell::Get()->display_configurator()->requested_power_state());
}
void StoreCurrentDisplayRotationLockPrefs() {
- bool rotation_lock = ash::Shell::GetInstance()->display_manager()->
- registered_internal_display_rotation_lock();
+ bool rotation_lock = ash::Shell::Get()
+ ->display_manager()
+ ->registered_internal_display_rotation_lock();
StoreDisplayRotationPrefs(rotation_lock);
}
@@ -441,7 +441,7 @@
// Do not store prefs when the confirmation dialog is shown.
if (!UserCanSaveDisplayPreference() ||
- !ash::Shell::GetInstance()->ShouldSaveDisplaySettings()) {
+ !ash::Shell::Get()->ShouldSaveDisplaySettings()) {
return;
}
@@ -474,7 +474,7 @@
std::string value = local_state->GetString(prefs::kDisplayPowerState);
chromeos::DisplayPowerState power_state;
if (GetDisplayPowerStateFromString(value, &power_state)) {
- ash::Shell::GetInstance()->display_configurator()->SetInitialDisplayPower(
+ ash::Shell::Get()->display_configurator()->SetInitialDisplayPower(
power_state);
}
}
diff --git a/chrome/browser/chromeos/display/display_preferences_unittest.cc b/chrome/browser/chromeos/display/display_preferences_unittest.cc
index 68dee38..e2cf68c 100644
--- a/chrome/browser/chromeos/display/display_preferences_unittest.cc
+++ b/chrome/browser/chromeos/display/display_preferences_unittest.cc
@@ -59,9 +59,7 @@
const float kMeanGravity = -9.80665f;
bool IsRotationLocked() {
- return ash::Shell::GetInstance()
- ->screen_orientation_controller()
- ->rotation_locked();
+ return ash::Shell::Get()->screen_orientation_controller()->rotation_locked();
}
class DisplayPreferencesTest : public ash::test::AshTestBase {
@@ -199,7 +197,7 @@
std::string GetRegisteredDisplayPlacementStr(
const display::DisplayIdList& list) {
- return ash::Shell::GetInstance()
+ return ash::Shell::Get()
->display_manager()
->layout_store()
->GetRegisteredDisplayLayout(list)
@@ -234,7 +232,7 @@
StoreDisplayPowerStateForTest(
chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON);
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
LoadDisplayPreferences(true);
// DisplayPowerState should be ignored at boot.
@@ -259,7 +257,7 @@
TEST_F(DisplayPreferencesTest, BasicStores) {
ash::WindowTreeHostManager* window_tree_host_manager =
- ash::Shell::GetInstance()->window_tree_host_manager();
+ ash::Shell::Get()->window_tree_host_manager();
UpdateDisplay("200x200*2, 400x300#400x400|300x200*1.25");
int64_t id1 = display::Screen::GetScreen()->GetPrimaryDisplay().id();
@@ -471,9 +469,9 @@
EXPECT_EQ(base::Int64ToString(id2), primary_id_str);
display_manager()->SetLayoutForCurrentDisplays(
- display::test::CreateDisplayLayout(
- ash::Shell::GetInstance()->display_manager(),
- display::DisplayPlacement::BOTTOM, 20));
+ display::test::CreateDisplayLayout(ash::Shell::Get()->display_manager(),
+ display::DisplayPlacement::BOTTOM,
+ 20));
UpdateDisplay("1+0-200x200*2,1+0-200x200");
// Mirrored.
@@ -570,7 +568,7 @@
int64_t id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
// Set display's resolution in single display. It creates the notification and
// display preferences should not stored meanwhile.
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
scoped_refptr<display::ManagedDisplayMode> old_mode(
new display::ManagedDisplayMode(gfx::Size(400, 300)));
@@ -600,7 +598,7 @@
// Once the notification is removed, the specified resolution will be stored
// by SetDisplayMode.
- ash::Shell::GetInstance()->display_manager()->SetDisplayMode(
+ ash::Shell::Get()->display_manager()->SetDisplayMode(
id, make_scoped_refptr(new display::ManagedDisplayMode(
gfx::Size(300, 200), 60.0f, false, true)));
UpdateDisplay("300x200#500x400|400x300|300x200");
@@ -700,8 +698,7 @@
profiles.push_back(display::COLOR_PROFILE_DYNAMIC);
profiles.push_back(display::COLOR_PROFILE_MOVIE);
profiles.push_back(display::COLOR_PROFILE_READING);
- display::test::DisplayManagerTestApi(
- ash::Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager())
.SetAvailableColorProfiles(id1, profiles);
LoadDisplayPreferences(false);
@@ -711,14 +708,14 @@
TEST_F(DisplayPreferencesTest, DontStoreInGuestMode) {
ash::WindowTreeHostManager* window_tree_host_manager =
- ash::Shell::GetInstance()->window_tree_host_manager();
+ ash::Shell::Get()->window_tree_host_manager();
UpdateDisplay("200x200*2,200x200");
LoggedInAsGuest();
int64_t id1 = display::Screen::GetScreen()->GetPrimaryDisplay().id();
display::test::ScopedSetInternalDisplayId set_internal(
- ash::Shell::GetInstance()->display_manager(), id1);
+ ash::Shell::Get()->display_manager(), id1);
int64_t id2 = display_manager()->GetSecondaryDisplay().id();
display_manager()->SetLayoutForCurrentDisplays(
display::test::CreateDisplayLayout(display_manager(),
@@ -789,12 +786,11 @@
chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON);
LoadDisplayPreferences(false);
EXPECT_EQ(chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON,
- ash::Shell::GetInstance()->display_configurator()->
- requested_power_state());
+ ash::Shell::Get()->display_configurator()->requested_power_state());
}
TEST_F(DisplayPreferencesTest, DontSaveAndRestoreAllOff) {
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
StoreDisplayPowerStateForTest(
chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON);
LoadDisplayPreferences(false);
@@ -819,7 +815,7 @@
// Tests that display configuration changes caused by MaximizeModeController
// are not saved.
TEST_F(DisplayPreferencesTest, DontSaveMaximizeModeControllerRotations) {
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
display::Display::SetInternalDisplayId(
display::Screen::GetScreen()->GetPrimaryDisplay().id());
LoggedInAsUser();
@@ -1000,9 +996,7 @@
display::Screen::GetScreen()->GetPrimaryDisplay().id());
ASSERT_FALSE(local_state()->HasPrefPath(prefs::kDisplayRotationLock));
- ash::Shell::GetInstance()
- ->screen_orientation_controller()
- ->ToggleUserRotationLock();
+ ash::Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock();
EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayRotationLock));
diff --git a/chrome/browser/chromeos/display/output_protection_controller_ash.cc b/chrome/browser/chromeos/display/output_protection_controller_ash.cc
index 9a7db15..8e4535d8 100644
--- a/chrome/browser/chromeos/display/output_protection_controller_ash.cc
+++ b/chrome/browser/chromeos/display/output_protection_controller_ash.cc
@@ -9,7 +9,7 @@
namespace chromeos {
OutputProtectionControllerAsh::OutputProtectionControllerAsh()
- : client_id_(ash::Shell::GetInstance()
+ : client_id_(ash::Shell::Get()
->display_configurator()
->RegisterContentProtectionClient()) {}
@@ -17,7 +17,7 @@
DCHECK(thread_checker_.CalledOnValidThread());
if (client_id_ != display::DisplayConfigurator::INVALID_CLIENT_ID) {
display::DisplayConfigurator* configurator =
- ash::Shell::GetInstance()->display_configurator();
+ ash::Shell::Get()->display_configurator();
configurator->UnregisterContentProtectionClient(client_id_);
}
}
@@ -27,7 +27,7 @@
const OutputProtectionDelegate::QueryStatusCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
display::DisplayConfigurator* configurator =
- ash::Shell::GetInstance()->display_configurator();
+ ash::Shell::Get()->display_configurator();
configurator->QueryContentProtectionStatus(client_id_, display_id, callback);
}
@@ -37,7 +37,7 @@
const OutputProtectionDelegate::SetProtectionCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
display::DisplayConfigurator* configurator =
- ash::Shell::GetInstance()->display_configurator();
+ ash::Shell::Get()->display_configurator();
configurator->SetContentProtection(client_id_, display_id,
desired_method_mask, callback);
}
diff --git a/chrome/browser/chromeos/display/overscan_calibrator.cc b/chrome/browser/chromeos/display/overscan_calibrator.cc
index 0cc03f7f..1b8ca62 100644
--- a/chrome/browser/chromeos/display/overscan_calibrator.cc
+++ b/chrome/browser/chromeos/display/overscan_calibrator.cc
@@ -78,16 +78,15 @@
committed_(false) {
// Undo the overscan calibration temporarily so that the user can see
// dark boundary and current overscan region.
- ash::Shell::GetInstance()->window_tree_host_manager()->SetOverscanInsets(
+ ash::Shell::Get()->window_tree_host_manager()->SetOverscanInsets(
display_.id(), gfx::Insets());
display::ManagedDisplayInfo info =
- ash::Shell::GetInstance()->display_manager()->GetDisplayInfo(
- display_.id());
+ ash::Shell::Get()->display_manager()->GetDisplayInfo(display_.id());
- aura::Window* root = ash::Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display_.id());
+ aura::Window* root =
+ ash::Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display_.id());
ui::Layer* parent_layer =
ash::Shell::GetContainer(root, ash::kShellWindowId_OverlayContainer)
->layer();
@@ -103,13 +102,13 @@
// Overscan calibration has finished without commit, so the display has to
// be the original offset.
if (!committed_) {
- ash::Shell::GetInstance()->window_tree_host_manager()->SetOverscanInsets(
+ ash::Shell::Get()->window_tree_host_manager()->SetOverscanInsets(
display_.id(), initial_insets_);
}
}
void OverscanCalibrator::Commit() {
- ash::Shell::GetInstance()->window_tree_host_manager()->SetOverscanInsets(
+ ash::Shell::Get()->window_tree_host_manager()->SetOverscanInsets(
display_.id(), insets_);
committed_ = true;
}
diff --git a/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc b/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc
index f22da18..58e1f8c 100644
--- a/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc
+++ b/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc
@@ -39,7 +39,7 @@
is_calibrating_ = true;
callback_ = callback;
- ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->AddObserver(this);
target_display_ = target_display;
// Clear all touch calibrator views used in any previous calibration.
@@ -57,11 +57,10 @@
base::MakeUnique<TouchCalibratorView>(display, is_primary_view);
}
- ash::Shell::GetInstance()->touch_transformer_controller()->SetForCalibration(
- true);
+ ash::Shell::Get()->touch_transformer_controller()->SetForCalibration(true);
// Add self as an event handler target.
- ash::Shell::GetInstance()->AddPreTargetHandler(this);
+ ash::Shell::Get()->AddPreTargetHandler(this);
}
void TouchCalibratorController::StopCalibration() {
@@ -69,13 +68,12 @@
return;
is_calibrating_ = false;
- ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
- ash::Shell::GetInstance()->touch_transformer_controller()->SetForCalibration(
- false);
+ ash::Shell::Get()->touch_transformer_controller()->SetForCalibration(false);
// Remove self as the event handler.
- ash::Shell::GetInstance()->RemovePreTargetHandler(this);
+ ash::Shell::Get()->RemovePreTargetHandler(this);
// Transition all touch calibrator views to their final state for a graceful
// exit.
@@ -122,7 +120,7 @@
callback_.Reset();
}
StopCalibration();
- ash::Shell::GetInstance()->display_manager()->SetTouchCalibrationData(
+ ash::Shell::Get()->display_manager()->SetTouchCalibrationData(
target_display_.id(), touch_point_quad_,
target_screen_calibration_view->size());
return;
diff --git a/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller_unittest.cc b/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller_unittest.cc
index 6e3b8417..aef05cc 100644
--- a/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller_unittest.cc
+++ b/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller_unittest.cc
@@ -75,7 +75,7 @@
TouchCalibratorController touch_calibrator_controller;
StartCalibrationChecks(&touch_calibrator_controller, touch_display);
- ui::EventTargetTestApi test_api(ash::Shell::GetInstance());
+ ui::EventTargetTestApi test_api(ash::Shell::Get());
const ui::EventHandlerList& handlers = test_api.pre_target_handlers();
ui::EventHandlerList::const_iterator event_target =
std::find(handlers.begin(), handlers.end(), &touch_calibrator_controller);
diff --git a/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_view.cc b/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_view.cc
index 8c52f1c..32ff477 100644
--- a/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_view.cc
+++ b/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_view.cc
@@ -470,9 +470,9 @@
throbber_circle_(nullptr),
hint_box_view_(nullptr),
touch_point_view_(nullptr) {
- aura::Window* root = ash::Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display_.id());
+ aura::Window* root =
+ ash::Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display_.id());
widget_.reset(new views::Widget);
widget_->Init(GetWidgetParams(root));
widget_->SetContentsView(this);
diff --git a/chrome/browser/chromeos/events/event_rewriter_unittest.cc b/chrome/browser/chromeos/events/event_rewriter_unittest.cc
index 6feaba2b..da0c7f0 100644
--- a/chrome/browser/chromeos/events/event_rewriter_unittest.cc
+++ b/chrome/browser/chromeos/events/event_rewriter_unittest.cc
@@ -1952,8 +1952,7 @@
void SetUp() override {
AshTestBase::SetUp();
- sticky_keys_controller_ =
- ash::Shell::GetInstance()->sticky_keys_controller();
+ sticky_keys_controller_ = ash::Shell::Get()->sticky_keys_controller();
delegate_ = base::MakeUnique<EventRewriterDelegateImpl>();
delegate_->set_pref_service_for_testing(prefs());
rewriter_ = base::MakeUnique<ui::EventRewriterChromeOS>(
diff --git a/chrome/browser/chromeos/extensions/input_method_api.cc b/chrome/browser/chromeos/extensions/input_method_api.cc
index 305449f7..372286b 100644
--- a/chrome/browser/chromeos/extensions/input_method_api.cc
+++ b/chrome/browser/chromeos/extensions/input_method_api.cc
@@ -257,7 +257,7 @@
// Forcibly enables the a11y onscreen keyboard if there is on keyboard enabled
// for now. And re-disables it after showing once.
keyboard::SetAccessibilityKeyboardEnabled(true);
- ash::Shell::GetInstance()->CreateKeyboard();
+ ash::Shell::Get()->CreateKeyboard();
keyboard_controller = keyboard::KeyboardController::GetInstance();
if (!keyboard_controller) {
keyboard::SetAccessibilityKeyboardEnabled(false);
diff --git a/chrome/browser/chromeos/first_run/chromeos_first_run_browsertest.cc b/chrome/browser/chromeos/first_run/chromeos_first_run_browsertest.cc
index 4a23cbff..a958beb 100644
--- a/chrome/browser/chromeos/first_run/chromeos_first_run_browsertest.cc
+++ b/chrome/browser/chromeos/first_run/chromeos_first_run_browsertest.cc
@@ -135,8 +135,7 @@
content::RunAllPendingInMessageLoop();
EXPECT_EQ(controller(), (void*)NULL);
// shell_helper() is destructed already, thats why we call Shell directly.
- EXPECT_FALSE(ash::Shell::GetInstance()->GetPrimarySystemTray()->
- HasSystemBubble());
+ EXPECT_FALSE(ash::Shell::Get()->GetPrimarySystemTray()->HasSystemBubble());
}
} // namespace chromeos
diff --git a/chrome/browser/chromeos/first_run/first_run_controller.cc b/chrome/browser/chromeos/first_run/first_run_controller.cc
index bafa97e..09e8242 100644
--- a/chrome/browser/chromeos/first_run/first_run_controller.cc
+++ b/chrome/browser/chromeos/first_run/first_run_controller.cc
@@ -77,7 +77,7 @@
user_profile_ = ProfileHelper::Get()->GetProfileByUserUnsafe(
user_manager->GetActiveUser());
- shell_helper_.reset(ash::Shell::GetInstance()->CreateFirstRunHelper());
+ shell_helper_.reset(ash::Shell::Get()->CreateFirstRunHelper());
shell_helper_->AddObserver(this);
FirstRunView* view = new FirstRunView();
diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc
index 5d95dd6..83e5e0a 100644
--- a/chrome/browser/chromeos/login/kiosk_browsertest.cc
+++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc
@@ -2329,11 +2329,11 @@
LoginDisplayHostImpl::DisableRestrictiveProxyCheckForTest();
KioskTest::SetUpOnMainThread();
- ash::Shell::GetInstance()->wallpaper_controller()->AddObserver(this);
+ ash::Shell::Get()->wallpaper_controller()->AddObserver(this);
}
void TearDownOnMainThread() override {
- ash::Shell::GetInstance()->wallpaper_controller()->RemoveObserver(this);
+ ash::Shell::Get()->wallpaper_controller()->RemoveObserver(this);
KioskTest::TearDownOnMainThread();
}
diff --git a/chrome/browser/chromeos/login/lock/screen_locker.cc b/chrome/browser/chromeos/login/lock/screen_locker.cc
index 0817358..e1ed221 100644
--- a/chrome/browser/chromeos/login/lock/screen_locker.cc
+++ b/chrome/browser/chromeos/login/lock/screen_locker.cc
@@ -158,12 +158,11 @@
manager->Initialize(SOUND_UNLOCK,
bundle.GetRawDataResource(IDR_SOUND_UNLOCK_WAV));
- ash::Shell::GetInstance()
- ->lock_state_controller()
- ->SetLockScreenDisplayedCallback(base::Bind(
- base::IgnoreResult(&AccessibilityManager::PlayEarcon),
- base::Unretained(AccessibilityManager::Get()), chromeos::SOUND_LOCK,
- PlaySoundOption::SPOKEN_FEEDBACK_ENABLED));
+ ash::Shell::Get()->lock_state_controller()->SetLockScreenDisplayedCallback(
+ base::Bind(base::IgnoreResult(&AccessibilityManager::PlayEarcon),
+ base::Unretained(AccessibilityManager::Get()),
+ chromeos::SOUND_LOCK,
+ PlaySoundOption::SPOKEN_FEEDBACK_ENABLED));
}
void ScreenLocker::Init() {
@@ -413,7 +412,7 @@
if (g_screen_lock_observer->session_started() &&
user_manager::UserManager::Get()->CanCurrentUserLock()) {
ScreenLocker::Show();
- ash::Shell::GetInstance()->lock_state_controller()->OnStartingLock();
+ ash::Shell::Get()->lock_state_controller()->OnStartingLock();
} else {
// If the current user's session cannot be locked or the user has not
// completed all sign-in steps yet, log out instead. The latter is done to
@@ -484,8 +483,7 @@
BrowserThread::UI, FROM_HERE, base::Bind([] {
base::Callback<void(void)> callback =
base::Bind(&ScreenLocker::ScheduleDeletion);
- ash::Shell::GetInstance()->lock_state_controller()->OnLockScreenHide(
- callback);
+ ash::Shell::Get()->lock_state_controller()->OnLockScreenHide(callback);
}));
}
@@ -515,7 +513,7 @@
ClearErrors();
VLOG(1) << "Moving wallpaper to unlocked container";
- ash::Shell::GetInstance()->wallpaper_controller()->MoveToUnlockedContainer();
+ ash::Shell::Get()->wallpaper_controller()->MoveToUnlockedContainer();
screen_locker_ = NULL;
bool state = false;
@@ -546,7 +544,7 @@
UMA_HISTOGRAM_TIMES("ScreenLocker.ScreenLockTime", delta);
VLOG(1) << "Moving wallpaper to locked container";
- ash::Shell::GetInstance()->wallpaper_controller()->MoveToLockedContainer();
+ ash::Shell::Get()->wallpaper_controller()->MoveToLockedContainer();
bool state = true;
VLOG(1) << "Emitting SCREEN_LOCK_STATE_CHANGED with state=" << state;
diff --git a/chrome/browser/chromeos/login/lock/webui_screen_locker.cc b/chrome/browser/chromeos/login/lock/webui_screen_locker.cc
index 0180503..9413fee 100644
--- a/chrome/browser/chromeos/login/lock/webui_screen_locker.cc
+++ b/chrome/browser/chromeos/login/lock/webui_screen_locker.cc
@@ -126,7 +126,7 @@
weak_factory_(this) {
set_should_emit_login_prompt_visible(false);
ash::WmShell::Get()->AddLockStateObserver(this);
- ash::Shell::GetInstance()->AddShellObserver(this);
+ ash::Shell::Get()->AddShellObserver(this);
display::Screen::GetScreen()->AddObserver(this);
DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this);
@@ -140,7 +140,7 @@
DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
display::Screen::GetScreen()->RemoveObserver(this);
ash::WmShell::Get()->RemoveLockStateObserver(this);
- ash::Shell::GetInstance()->RemoveShellObserver(this);
+ ash::Shell::Get()->RemoveShellObserver(this);
// In case of shutdown, lock_window_ may be deleted before WebUIScreenLocker.
if (lock_window_) {
lock_window_->RemoveObserver(this);
@@ -271,7 +271,7 @@
void WebUIScreenLocker::OnHeaderBarVisible() {
DCHECK(ash::Shell::HasInstance());
- ash::Shell::GetInstance()->power_event_observer()->OnLockAnimationsComplete();
+ ash::Shell::Get()->power_event_observer()->OnLockAnimationsComplete();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/chromeos/login/login_browsertest.cc b/chrome/browser/chromeos/login/login_browsertest.cc
index c98ee6b2..3d64428 100644
--- a/chrome/browser/chromeos/login/login_browsertest.cc
+++ b/chrome/browser/chromeos/login/login_browsertest.cc
@@ -309,7 +309,7 @@
// Used to make sure that the system tray is visible and within the screen
// bounds after login.
void TestSystemTrayIsVisible(bool otr) {
- ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
+ ash::SystemTray* tray = ash::Shell::Get()->GetPrimarySystemTray();
aura::Window* primary_win = ash::Shell::GetPrimaryRootWindow();
ash::WmWindow* wm_primary_win = ash::WmWindow::Get(primary_win);
ash::WmShelf* wm_shelf = ash::WmShelf::ForWindow(wm_primary_win);
@@ -340,7 +340,7 @@
// Verifies the cursor is not hidden at startup when user is logged in.
IN_PROC_BROWSER_TEST_F(LoginUserTest, CursorShown) {
- EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
+ EXPECT_TRUE(ash::Shell::Get()->cursor_manager()->IsCursorVisible());
TestSystemTrayIsVisible(false);
}
@@ -357,7 +357,7 @@
// Verifies the cursor is not hidden at startup when running guest session.
IN_PROC_BROWSER_TEST_F(LoginGuestTest, CursorShown) {
- EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
+ EXPECT_TRUE(ash::Shell::Get()->cursor_manager()->IsCursorVisible());
TestSystemTrayIsVisible(true);
}
@@ -368,11 +368,11 @@
ShowLoginWizard(OobeScreen::SCREEN_SPECIAL_LOGIN);
// Cursor should be hidden at startup
- EXPECT_FALSE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
+ EXPECT_FALSE(ash::Shell::Get()->cursor_manager()->IsCursorVisible());
// Cursor should be shown after cursor is moved.
EXPECT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point()));
- EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
+ EXPECT_TRUE(ash::Shell::Get()->cursor_manager()->IsCursorVisible());
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(
FROM_HERE, LoginDisplayHost::default_host());
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.cc b/chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.cc
index 40f554f..ea0e029 100644
--- a/chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.cc
+++ b/chrome/browser/chromeos/login/supervised/supervised_user_creation_screen.cc
@@ -365,7 +365,7 @@
DCHECK(controller_.get());
// For manager user, move wallpaper to locked container so that windows
// created during the user image picker step are below it.
- ash::Shell::GetInstance()->wallpaper_controller()->MoveToLockedContainer();
+ ash::Shell::Get()->wallpaper_controller()->MoveToLockedContainer();
controller_->SetManagerProfile(manager_profile);
if (view_)
diff --git a/chrome/browser/chromeos/login/ui/input_events_blocker.cc b/chrome/browser/chromeos/login/ui/input_events_blocker.cc
index 43ad7da6..4959321 100644
--- a/chrome/browser/chromeos/login/ui/input_events_blocker.cc
+++ b/chrome/browser/chromeos/login/ui/input_events_blocker.cc
@@ -15,7 +15,7 @@
// TODO(mash): Implement a mash version. This will probably need to talk to
// the window server.
if (!ash_util::IsRunningInMash()) {
- ash::Shell::GetInstance()->PrependPreTargetHandler(this);
+ ash::Shell::Get()->PrependPreTargetHandler(this);
VLOG(1) << "InputEventsBlocker " << this << " created.";
} else {
NOTIMPLEMENTED();
@@ -24,7 +24,7 @@
InputEventsBlocker::~InputEventsBlocker() {
if (!ash_util::IsRunningInMash()) {
- ash::Shell::GetInstance()->RemovePreTargetHandler(this);
+ ash::Shell::Get()->RemovePreTargetHandler(this);
VLOG(1) << "InputEventsBlocker " << this << " destroyed.";
} else {
NOTIMPLEMENTED();
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
index 5230a0d..e0fdaa03 100644
--- a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
+++ b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
@@ -304,17 +304,17 @@
: public ui::EventHandler {
public:
KeyboardDrivenOobeKeyHandler() {
- ash::Shell::GetInstance()->AddPreTargetHandler(this);
+ ash::Shell::Get()->AddPreTargetHandler(this);
}
~KeyboardDrivenOobeKeyHandler() override {
- ash::Shell::GetInstance()->RemovePreTargetHandler(this);
+ ash::Shell::Get()->RemovePreTargetHandler(this);
}
private:
// ui::EventHandler
void OnKeyEvent(ui::KeyEvent* event) override {
if (event->key_code() == ui::VKEY_F6) {
- ash::Shell::GetInstance()->GetPrimarySystemTray()->CloseSystemBubble();
+ ash::Shell::Get()->GetPrimarySystemTray()->CloseSystemBubble();
event->StopPropagation();
}
}
@@ -379,7 +379,7 @@
}
if (!ash_util::IsRunningInMash())
- ash::Shell::GetInstance()->AddShellObserver(this);
+ ash::Shell::Get()->AddShellObserver(this);
else
NOTIMPLEMENTED();
display::Screen::GetScreen()->AddObserver(this);
@@ -498,7 +498,7 @@
}
if (!ash_util::IsRunningInMash())
- ash::Shell::GetInstance()->RemoveShellObserver(this);
+ ash::Shell::Get()->RemoveShellObserver(this);
else
NOTIMPLEMENTED();
display::Screen::GetScreen()->RemoveObserver(this);
@@ -561,9 +561,7 @@
// See crbug.com/541864.
if (ash::WmShell::HasInstance() &&
finalize_animation_type_ != ANIMATION_ADD_USER) {
- ash::Shell::GetInstance()
- ->wallpaper_controller()
- ->MoveToUnlockedContainer();
+ ash::Shell::Get()->wallpaper_controller()->MoveToUnlockedContainer();
}
switch (finalize_animation_type_) {
@@ -687,7 +685,7 @@
ash::kShellWindowId_LockScreenContainersContainer);
lock_container->layer()->SetOpacity(1.0);
- ash::Shell::GetInstance()->wallpaper_controller()->MoveToLockedContainer();
+ ash::Shell::Get()->wallpaper_controller()->MoveToLockedContainer();
} else {
NOTIMPLEMENTED();
}
@@ -950,9 +948,7 @@
if (!ash_util::IsRunningInMash()) {
// For new user, move wallpaper to lock container so that windows created
// during the user image picker step are below it.
- ash::Shell::GetInstance()
- ->wallpaper_controller()
- ->MoveToLockedContainer();
+ ash::Shell::Get()->wallpaper_controller()->MoveToLockedContainer();
} else {
NOTIMPLEMENTED();
}
@@ -1124,9 +1120,7 @@
if (ash::Shell::HasInstance() &&
finalize_animation_type_ == ANIMATION_ADD_USER) {
if (!ash_util::IsRunningInMash()) {
- ash::Shell::GetInstance()
- ->wallpaper_controller()
- ->MoveToUnlockedContainer();
+ ash::Shell::Get()->wallpaper_controller()->MoveToUnlockedContainer();
} else {
NOTIMPLEMENTED();
}
@@ -1149,7 +1143,7 @@
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableLoginAnimations))
- ash::Shell::GetInstance()->DoInitialWorkspaceAnimation();
+ ash::Shell::Get()->DoInitialWorkspaceAnimation();
}
void LoginDisplayHostImpl::ScheduleFadeOutAnimation(int animation_speed_ms) {
diff --git a/chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc b/chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc
index afaec93..2ae57ed 100644
--- a/chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc
+++ b/chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc
@@ -25,7 +25,7 @@
aura::client::ActivationClient* activation_client =
aura::client::GetActivationClient(
- ash::Shell::GetInstance()->GetPrimaryRootWindow());
+ ash::Shell::Get()->GetPrimaryRootWindow());
aura::Window* window = activation_client->GetActiveWindow();
ASSERT_TRUE(window);
EXPECT_EQ(0, window->GetProperty(aura::client::kResizeBehaviorKey) &
diff --git a/chrome/browser/chromeos/login/ui/user_adding_screen.cc b/chrome/browser/chromeos/login/ui/user_adding_screen.cc
index 92897ba8..11a5643 100644
--- a/chrome/browser/chromeos/login/ui/user_adding_screen.cc
+++ b/chrome/browser/chromeos/login/ui/user_adding_screen.cc
@@ -64,7 +64,7 @@
CHECK(IsRunning());
// Make sure that system tray is enabled after this flow.
- ash::Shell::GetInstance()->GetPrimarySystemTray()->SetEnabled(true);
+ ash::Shell::Get()->GetPrimarySystemTray()->SetEnabled(true);
display_host_->CancelUserAdding();
// Reset wallpaper if cancel adding user from multiple user sign in page.
diff --git a/chrome/browser/chromeos/login/ui/webui_login_view.cc b/chrome/browser/chromeos/login/ui/webui_login_view.cc
index 7e964d5..594d1a8 100644
--- a/chrome/browser/chromeos/login/ui/webui_login_view.cc
+++ b/chrome/browser/chromeos/login/ui/webui_login_view.cc
@@ -174,9 +174,8 @@
observer.OnHostDestroying();
if (!ash_util::IsRunningInMash() &&
- ash::Shell::GetInstance()->HasPrimaryStatusArea()) {
- ash::Shell::GetInstance()->GetPrimarySystemTray()->SetNextFocusableView(
- nullptr);
+ ash::Shell::Get()->HasPrimaryStatusArea()) {
+ ash::Shell::Get()->GetPrimarySystemTray()->SetNextFocusableView(nullptr);
} else {
NOTIMPLEMENTED();
}
@@ -457,7 +456,7 @@
if (ash_util::IsRunningInMash())
return true;
- ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
+ ash::SystemTray* tray = ash::Shell::Get()->GetPrimarySystemTray();
if (tray && tray->GetWidget()->IsVisible()) {
tray->SetNextFocusableView(this);
ash::Shell::Get()->focus_cycler()->RotateFocus(
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
index 6ab667ec..960cc50 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -213,8 +213,7 @@
} else if (ash::Shell::HasInstance()) {
// Note: Wallpaper setting is skipped in unit tests without shell instances.
// In classic ash, interact with the WallpaperController class directly.
- ash::Shell::GetInstance()->wallpaper_controller()->SetWallpaperImage(
- image, layout);
+ ash::Shell::Get()->wallpaper_controller()->SetWallpaperImage(image, layout);
}
}
@@ -473,7 +472,7 @@
// Zero delays is also set in autotests.
if (WizardController::IsZeroDelayEnabled()) {
// Ensure tests have some sort of wallpaper.
- ash::Shell::GetInstance()->wallpaper_controller()->CreateEmptyWallpaper();
+ ash::Shell::Get()->wallpaper_controller()->CreateEmptyWallpaper();
return;
}
@@ -1349,7 +1348,7 @@
default_large_wallpaper_file_ = default_large_wallpaper_file;
ash::WallpaperController* controller =
- ash::Shell::GetInstance()->wallpaper_controller();
+ ash::Shell::Get()->wallpaper_controller();
// |need_update_screen| is true if the previous default wallpaper is visible
// now, so we need to update wallpaper on the screen.
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc
index f549c17..0fd9719 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc
@@ -72,7 +72,7 @@
~WallpaperManagerBrowserTest() override {}
void SetUpOnMainThread() override {
- controller_ = ash::Shell::GetInstance()->wallpaper_controller();
+ controller_ = ash::Shell::Get()->wallpaper_controller();
controller_->set_wallpaper_reload_delay_for_test(0);
local_state_ = g_browser_process->local_state();
UpdateDisplay("800x600");
@@ -88,8 +88,7 @@
// Update the display configuration as given in |display_specs|. See
// display::test::DisplayManagerTestApi::UpdateDisplay for more details.
void UpdateDisplay(const std::string& display_specs) {
- display::test::DisplayManagerTestApi(
- ash::Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager())
.UpdateDisplay(display_specs);
}
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_policy_browsertest.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_policy_browsertest.cc
index 8cc1e308..f3af87e 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_policy_browsertest.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_policy_browsertest.cc
@@ -123,7 +123,7 @@
// Obtain wallpaper image and return its average ARGB color.
SkColor GetAverageWallpaperColor() {
const gfx::ImageSkia image =
- ash::Shell::GetInstance()->wallpaper_controller()->GetWallpaper();
+ ash::Shell::Get()->wallpaper_controller()->GetWallpaper();
const gfx::ImageSkiaRep& representation = image.GetRepresentation(1.);
if (representation.is_null()) {
@@ -219,7 +219,7 @@
void SetUpOnMainThread() override {
LoginManagerTest::SetUpOnMainThread();
- ash::Shell::GetInstance()->wallpaper_controller()->AddObserver(this);
+ ash::Shell::Get()->wallpaper_controller()->AddObserver(this);
// Set up policy signing.
user_policy_builders_[0] = GetUserPolicyBuilder(testUsers_[0]);
@@ -227,7 +227,7 @@
}
void TearDownOnMainThread() override {
- ash::Shell::GetInstance()->wallpaper_controller()->RemoveObserver(this);
+ ash::Shell::Get()->wallpaper_controller()->RemoveObserver(this);
LoginManagerTest::TearDownOnMainThread();
}
diff --git a/chrome/browser/chromeos/policy/device_system_use_24hour_clock_browsertest.cc b/chrome/browser/chromeos/policy/device_system_use_24hour_clock_browsertest.cc
index 5815911..2b95c5d 100644
--- a/chrome/browser/chromeos/policy/device_system_use_24hour_clock_browsertest.cc
+++ b/chrome/browser/chromeos/policy/device_system_use_24hour_clock_browsertest.cc
@@ -76,7 +76,7 @@
static base::HourClockType TestGetPrimarySystemTrayTimeHourType() {
const ash::TraySystemInfo* tray_system_info =
- ash::Shell::GetInstance()
+ ash::Shell::Get()
->GetPrimarySystemTray()
->GetTraySystemInfoForTesting();
const ash::tray::TimeView* time_tray =
@@ -87,7 +87,7 @@
static bool TestPrimarySystemTrayHasDateDefaultView() {
const ash::TraySystemInfo* tray_system_info =
- ash::Shell::GetInstance()
+ ash::Shell::Get()
->GetPrimarySystemTray()
->GetTraySystemInfoForTesting();
const ash::SystemInfoDefaultView* system_info_default_view =
@@ -96,7 +96,7 @@
}
static void TestPrimarySystemTrayCreateDefaultView() {
- ash::TraySystemInfo* tray_system_info = ash::Shell::GetInstance()
+ ash::TraySystemInfo* tray_system_info = ash::Shell::Get()
->GetPrimarySystemTray()
->GetTraySystemInfoForTesting();
tray_system_info->CreateDefaultViewForTesting(
@@ -105,7 +105,7 @@
static base::HourClockType TestGetPrimarySystemTrayDateHourType() {
const ash::TraySystemInfo* tray_system_info =
- ash::Shell::GetInstance()
+ ash::Shell::Get()
->GetPrimarySystemTray()
->GetTraySystemInfoForTesting();
const ash::SystemInfoDefaultView* system_info_default_view =
diff --git a/chrome/browser/chromeos/policy/display_rotation_default_handler.cc b/chrome/browser/chromeos/policy/display_rotation_default_handler.cc
index 44f55d7..a01c42a 100644
--- a/chrome/browser/chromeos/policy/display_rotation_default_handler.cc
+++ b/chrome/browser/chromeos/policy/display_rotation_default_handler.cc
@@ -20,8 +20,8 @@
namespace policy {
DisplayRotationDefaultHandler::DisplayRotationDefaultHandler() {
- ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
- ash::Shell::GetInstance()->AddShellObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->AddObserver(this);
+ ash::Shell::Get()->AddShellObserver(this);
settings_observer_ = chromeos::CrosSettings::Get()->AddSettingsObserver(
chromeos::kDisplayRotationDefault,
base::Bind(&DisplayRotationDefaultHandler::OnCrosSettingsChanged,
@@ -41,8 +41,8 @@
}
void DisplayRotationDefaultHandler::OnWindowTreeHostManagerShutdown() {
- ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
- ash::Shell::GetInstance()->RemoveShellObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
+ ash::Shell::Get()->RemoveShellObserver(this);
settings_observer_.reset();
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
@@ -64,7 +64,7 @@
rotation_in_progress_ = true;
display::DisplayManager* const display_manager =
- ash::Shell::GetInstance()->display_manager();
+ ash::Shell::Get()->display_manager();
const size_t num_displays = display_manager->GetNumDisplays();
for (size_t i = 0; i < num_displays; ++i) {
const display::Display& display = display_manager->GetDisplayAt(i);
diff --git a/chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc b/chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc
index 204d364..140fdce9 100644
--- a/chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc
+++ b/chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc
@@ -41,7 +41,7 @@
namespace {
display::DisplayManager* GetDisplayManager() {
- return ash::Shell::GetInstance()->display_manager();
+ return ash::Shell::Get()->display_manager();
}
display::Display::Rotation GetRotationOfFirstDisplay() {
diff --git a/chrome/browser/chromeos/policy/force_maximize_on_first_run_chromeos_browsertest.cc b/chrome/browser/chromeos/policy/force_maximize_on_first_run_chromeos_browsertest.cc
index 924ed4a..9b7538f 100644
--- a/chrome/browser/chromeos/policy/force_maximize_on_first_run_chromeos_browsertest.cc
+++ b/chrome/browser/chromeos/policy/force_maximize_on_first_run_chromeos_browsertest.cc
@@ -41,8 +41,7 @@
ash::WindowPositioner::GetForceMaximizedWidthLimit() + 100;
// Set resolution to 1466x300.
const std::string resolution = base::IntToString(width) + "x300";
- display::test::DisplayManagerTestApi(
- ash::Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager())
.UpdateDisplay(resolution);
}
diff --git a/chrome/browser/chromeos/power/login_lock_state_notifier.cc b/chrome/browser/chromeos/power/login_lock_state_notifier.cc
index b70ecc5e..f5a0022 100644
--- a/chrome/browser/chromeos/power/login_lock_state_notifier.cc
+++ b/chrome/browser/chromeos/power/login_lock_state_notifier.cc
@@ -24,7 +24,7 @@
const ScreenLocker* locker = ScreenLocker::default_screen_locker();
bool locked = locker && locker->locked();
- ash::Shell::GetInstance()->OnLockStateChanged(locked);
+ ash::Shell::Get()->OnLockStateChanged(locked);
}
LoginLockStateNotifier::~LoginLockStateNotifier() {}
@@ -35,11 +35,11 @@
const content::NotificationDetails& details) {
switch (type) {
case chrome::NOTIFICATION_APP_TERMINATING:
- ash::Shell::GetInstance()->OnAppTerminating();
+ ash::Shell::Get()->OnAppTerminating();
break;
case chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED: {
bool locked = *content::Details<bool>(details).ptr();
- ash::Shell::GetInstance()->OnLockStateChanged(locked);
+ ash::Shell::Get()->OnLockStateChanged(locked);
break;
}
default:
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index 58ff8f9..b8a4b6f3 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -82,7 +82,7 @@
// Do not observe shell, if there is no shell instance; e.g., in some unit
// tests.
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->AddShellObserver(this);
+ ash::Shell::Get()->AddShellObserver(this);
}
Preferences::Preferences(input_method::InputMethodManager* input_method_manager)
@@ -93,7 +93,7 @@
// Do not observe shell, if there is no shell instance; e.g., in some unit
// tests.
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->AddShellObserver(this);
+ ash::Shell::Get()->AddShellObserver(this);
}
Preferences::~Preferences() {
@@ -102,7 +102,7 @@
// If shell instance is destoryed before this preferences instance, there is
// no need to remove this shell observer.
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->RemoveShellObserver(this);
+ ash::Shell::Get()->RemoveShellObserver(this);
}
// static
@@ -552,8 +552,7 @@
// TODO: this needs to work in Config::MUS. http://crbug.com/705591.
if (ash::Shell::HasInstance() &&
chromeos::GetAshConfig() == ash::Config::CLASSIC) {
- ash::Shell::GetInstance()->display_manager()
- ->SetUnifiedDesktopEnabled(enabled);
+ ash::Shell::Get()->display_manager()->SetUnifiedDesktopEnabled(enabled);
}
}
if (reason != REASON_PREF_CHANGED || pref_name == prefs::kNaturalScroll) {
@@ -634,7 +633,7 @@
const bool enabled = touch_hud_projection_enabled_.GetValue();
// There may not be a shell, e.g., in some unit tests.
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->SetTouchHudProjectionEnabled(enabled);
+ ash::Shell::Get()->SetTouchHudProjectionEnabled(enabled);
}
}
diff --git a/chrome/browser/chromeos/preferences_chromeos_browsertest.cc b/chrome/browser/chromeos/preferences_chromeos_browsertest.cc
index 0233e32..fe2654d 100644
--- a/chrome/browser/chromeos/preferences_chromeos_browsertest.cc
+++ b/chrome/browser/chromeos/preferences_chromeos_browsertest.cc
@@ -112,7 +112,7 @@
EXPECT_EQ(prefs->GetInteger(prefs::kTouchpadSensitivity),
input_settings_->current_touchpad_settings().GetSensitivity());
EXPECT_EQ(prefs->GetBoolean(prefs::kTouchHudProjectionEnabled),
- ash::Shell::GetInstance()->is_touch_hud_projection_enabled());
+ ash::Shell::Get()->is_touch_hud_projection_enabled());
EXPECT_EQ(prefs->GetBoolean(prefs::kLanguageXkbAutoRepeatEnabled),
keyboard_->auto_repeat_is_enabled_);
input_method::AutoRepeatRate rate = keyboard_->last_auto_repeat_rate_;
diff --git a/chrome/browser/chromeos/shutdown_policy_browsertest.cc b/chrome/browser/chromeos/shutdown_policy_browsertest.cc
index ee1b3e0f..306e2df 100644
--- a/chrome/browser/chromeos/shutdown_policy_browsertest.cc
+++ b/chrome/browser/chromeos/shutdown_policy_browsertest.cc
@@ -145,18 +145,18 @@
// Opens the system tray menu. This creates the tray views.
void OpenSystemTrayMenu() {
- ash::Shell::GetInstance()->GetPrimarySystemTray()->ShowDefaultView(
+ ash::Shell::Get()->GetPrimarySystemTray()->ShowDefaultView(
ash::BUBBLE_CREATE_NEW);
}
// Closes the system tray menu. This deletes the tray views.
void CloseSystemTrayMenu() {
- ash::Shell::GetInstance()->GetPrimarySystemTray()->CloseSystemBubble();
+ ash::Shell::Get()->GetPrimarySystemTray()->CloseSystemBubble();
}
// Gets the shutdown button view.
const views::View* GetShutdownButton() {
- ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
+ ash::SystemTray* tray = ash::Shell::Get()->GetPrimarySystemTray();
return tray->GetTrayTilesForTesting()
->GetDefaultViewForTesting()
->GetShutdownButtonViewForTest();
diff --git a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc
index 561a403..a00fd5f 100644
--- a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc
+++ b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc
@@ -117,12 +117,13 @@
}
ash::TrayAccessibility* tray() {
- return ash::Shell::GetInstance()->GetPrimarySystemTray()->
- GetTrayAccessibilityForTest();
+ return ash::Shell::Get()
+ ->GetPrimarySystemTray()
+ ->GetTrayAccessibilityForTest();
}
const ash::TrayAccessibility* tray() const {
- return ash::Shell::GetInstance()
+ return ash::Shell::Get()
->GetPrimarySystemTray()
->GetTrayAccessibilityForTest();
}
diff --git a/chrome/browser/chromeos/ui/accessibility_focus_ring_controller_unittest.cc b/chrome/browser/chromeos/ui/accessibility_focus_ring_controller_unittest.cc
index 49ab7119..5f35ecda 100644
--- a/chrome/browser/chromeos/ui/accessibility_focus_ring_controller_unittest.cc
+++ b/chrome/browser/chromeos/ui/accessibility_focus_ring_controller_unittest.cc
@@ -135,8 +135,7 @@
TEST_F(AccessibilityFocusRingControllerTest, CursorWorksOnMultipleDisplays) {
UpdateDisplay("400x400,500x500");
- aura::Window::Windows root_windows =
- ash::Shell::GetInstance()->GetAllRootWindows();
+ aura::Window::Windows root_windows = ash::Shell::Get()->GetAllRootWindows();
ASSERT_EQ(2u, root_windows.size());
AccessibilityHighlightManager highlight_manager;
diff --git a/chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc b/chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc
index 86963db4..c141ca4 100644
--- a/chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc
+++ b/chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc
@@ -104,9 +104,9 @@
display::Display display =
display::Screen::GetScreen()->GetDisplayMatching(bounds);
- aura::Window* root_window = ash::Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display.id());
+ aura::Window* root_window =
+ ash::Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ display.id());
CreateOrUpdateLayer(root_window, "AccessibilityFocusRing", bounds);
}
diff --git a/chrome/browser/cryptauth/chrome_cryptauth_service.cc b/chrome/browser/cryptauth/chrome_cryptauth_service.cc
index 6d45f25..3429a5e 100644
--- a/chrome/browser/cryptauth/chrome_cryptauth_service.cc
+++ b/chrome/browser/cryptauth/chrome_cryptauth_service.cc
@@ -109,7 +109,7 @@
return device_info;
display::DisplayManager* display_manager =
- ash::Shell::GetInstance()->display_manager();
+ ash::Shell::Get()->display_manager();
int64_t primary_display_id =
display_manager->GetPrimaryDisplayCandidate().id();
display::ManagedDisplayInfo display_info =
diff --git a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
index fb86a51..7633b2e 100644
--- a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
+++ b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
@@ -125,7 +125,7 @@
// keyboard gets the correct state of the hotrod keyboard through
// chrome.virtualKeyboardPrivate.getKeyboardConfig.
if (keyboard::IsKeyboardEnabled())
- ash::Shell::GetInstance()->CreateKeyboard();
+ ash::Shell::Get()->CreateKeyboard();
}
void ChromeVirtualKeyboardDelegate::SetKeyboardRestricted(bool restricted) {
@@ -136,7 +136,7 @@
// Force virtual keyboard reload.
if (keyboard::IsKeyboardEnabled())
- ash::Shell::GetInstance()->CreateKeyboard();
+ ash::Shell::Get()->CreateKeyboard();
}
bool ChromeVirtualKeyboardDelegate::LockKeyboard(bool state) {
@@ -189,11 +189,10 @@
bool is_enabled = keyboard::IsKeyboardEnabled();
if (was_enabled == is_enabled)
return true;
- if (is_enabled) {
- ash::Shell::GetInstance()->CreateKeyboard();
- } else {
- ash::Shell::GetInstance()->DeactivateKeyboard();
- }
+ if (is_enabled)
+ ash::Shell::Get()->CreateKeyboard();
+ else
+ ash::Shell::Get()->DeactivateKeyboard();
return true;
}
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.cc b/chrome/browser/extensions/display_info_provider_chromeos.cc
index a5a37a74..a2de92c 100644
--- a/chrome/browser/extensions/display_info_provider_chromeos.cc
+++ b/chrome/browser/extensions/display_info_provider_chromeos.cc
@@ -40,8 +40,7 @@
int64_t display_id;
if (!base::StringToInt64(display_id_str, &display_id))
return display::Display();
- return ash::Shell::GetInstance()->display_manager()->GetDisplayForId(
- display_id);
+ return ash::Shell::Get()->display_manager()->GetDisplayForId(display_id);
}
// Checks if the given integer value is valid display rotation in degrees.
@@ -223,9 +222,8 @@
layout->placement_list.push_back(placement);
layout->primary_id = primary_display_id;
- ash::Shell::GetInstance()
- ->display_configuration_controller()
- ->SetDisplayLayout(std::move(layout));
+ ash::Shell::Get()->display_configuration_controller()->SetDisplayLayout(
+ std::move(layout));
}
// Validates that parameters passed to the SetInfo function are valid for the
@@ -350,7 +348,7 @@
if (!display::Display::IsInternalDisplayId(id)) {
// For external displays, show a notification confirming the resolution
// change.
- ash::Shell::GetInstance()
+ ash::Shell::Get()
->resolution_notification_controller()
->PrepareNotification(id, current_mode, new_mode,
base::Bind(&chromeos::StoreDisplayPrefs));
@@ -411,7 +409,7 @@
}
bool IsMaximizeModeWindowManagerEnabled() {
- return ash::Shell::GetInstance()
+ return ash::Shell::Get()
->maximize_mode_controller()
->IsMaximizeModeWindowManagerEnabled();
}
@@ -460,9 +458,9 @@
return false;
}
display::DisplayManager* display_manager =
- ash::Shell::GetInstance()->display_manager();
+ ash::Shell::Get()->display_manager();
ash::DisplayConfigurationController* display_configuration_controller =
- ash::Shell::GetInstance()->display_configuration_controller();
+ ash::Shell::Get()->display_configuration_controller();
const display::Display target = GetDisplay(display_id_str);
@@ -501,9 +499,8 @@
if (info.rotation) {
if (IsMaximizeModeWindowManagerEnabled() &&
display_id == display::Display::InternalDisplayId()) {
- ash::Shell::GetInstance()
- ->screen_orientation_controller()
- ->SetLockToRotation(DegreesToRotation(*info.rotation));
+ ash::Shell::Get()->screen_orientation_controller()->SetLockToRotation(
+ DegreesToRotation(*info.rotation));
} else {
display_configuration_controller->SetDisplayRotation(
display_id, DegreesToRotation(*info.rotation),
@@ -537,7 +534,7 @@
return false;
}
display::DisplayManager* display_manager =
- ash::Shell::GetInstance()->display_manager();
+ ash::Shell::Get()->display_manager();
display::DisplayLayoutBuilder builder(
display_manager->GetCurrentResolvedDisplayLayout());
@@ -569,9 +566,8 @@
LOG(ERROR) << "Invalid layout: Validate failed.";
return false;
}
- ash::Shell::GetInstance()
- ->display_configuration_controller()
- ->SetDisplayLayout(std::move(layout));
+ ash::Shell::Get()->display_configuration_controller()->SetDisplayLayout(
+ std::move(layout));
return true;
}
@@ -584,7 +580,7 @@
return;
}
display::DisplayManager* display_manager =
- ash::Shell::GetInstance()->display_manager();
+ ash::Shell::Get()->display_manager();
unit->name = display_manager->GetDisplayNameForId(display.id());
if (display_manager->IsInMirrorMode()) {
unit->mirroring_source_id =
@@ -619,8 +615,7 @@
NOTIMPLEMENTED();
return;
}
- ash::Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(
- enable);
+ ash::Shell::Get()->display_manager()->SetUnifiedDesktopEnabled(enable);
}
DisplayInfoProvider::DisplayUnitInfoList
@@ -631,7 +626,7 @@
return DisplayInfoProvider::DisplayUnitInfoList();
}
display::DisplayManager* display_manager =
- ash::Shell::GetInstance()->display_manager();
+ ash::Shell::Get()->display_manager();
if (!display_manager->IsInUnifiedMode())
return DisplayInfoProvider::GetAllDisplaysInfo();
@@ -659,7 +654,7 @@
return DisplayInfoProvider::DisplayLayoutList();
}
display::DisplayManager* display_manager =
- ash::Shell::GetInstance()->display_manager();
+ ash::Shell::Get()->display_manager();
if (display_manager->num_connected_displays() < 2)
return DisplayInfoProvider::DisplayLayoutList();
@@ -696,7 +691,7 @@
if (display.id() == display::kInvalidDisplayId)
return false;
auto insets =
- ash::Shell::GetInstance()->window_tree_host_manager()->GetOverscanInsets(
+ ash::Shell::Get()->window_tree_host_manager()->GetOverscanInsets(
display.id());
overscan_calibrators_[id].reset(
new chromeos::OverscanCalibrator(display, insets));
@@ -782,8 +777,7 @@
custom_touch_calibration_active_ = true;
// Enable un-transformed touch input.
- ash::Shell::GetInstance()->touch_transformer_controller()->SetForCalibration(
- true);
+ ash::Shell::Get()->touch_transformer_controller()->SetForCalibration(true);
return true;
}
@@ -798,8 +792,7 @@
}
VLOG(1) << "CompleteCustomTouchCalibration: " << touch_calibration_target_id_;
- ash::Shell::GetInstance()->touch_transformer_controller()->SetForCalibration(
- false);
+ ash::Shell::Get()->touch_transformer_controller()->SetForCalibration(false);
const display::Display display = GetDisplay(touch_calibration_target_id_);
touch_calibration_target_id_.clear();
@@ -847,7 +840,7 @@
}
gfx::Size display_size(bounds.width, bounds.height);
- ash::Shell::GetInstance()->display_manager()->SetTouchCalibrationData(
+ ash::Shell::Get()->display_manager()->SetTouchCalibrationData(
display.id(), calibration_points, display_size);
return true;
}
@@ -867,8 +860,7 @@
return false;
}
- ash::Shell::GetInstance()->display_manager()->ClearTouchCalibrationData(
- display.id());
+ ash::Shell::Get()->display_manager()->ClearTouchCalibrationData(display.id());
return true;
}
diff --git a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc
index 38e9950a..e4f65f2 100644
--- a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc
+++ b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc
@@ -32,7 +32,7 @@
using DisplayLayoutList = DisplayInfoProvider::DisplayLayoutList;
void EnableMaximizeMode(bool enable) {
- ash::Shell::GetInstance()
+ ash::Shell::Get()
->maximize_mode_controller()
->EnableMaximizeModeWindowManager(enable);
}
@@ -67,7 +67,7 @@
}
display::DisplayManager* GetDisplayManager() const {
- return ash::Shell::GetInstance()->display_manager();
+ return ash::Shell::Get()->display_manager();
}
std::string SystemInfoDisplayInsetsToString(
@@ -912,7 +912,7 @@
// upon exiting maximize mode, and that a rotation lock is not set.
TEST_F(DisplayInfoProviderChromeosTest, SetRotationBeforeMaximizeMode) {
ash::ScreenOrientationController* screen_orientation_controller =
- ash::Shell::GetInstance()->screen_orientation_controller();
+ ash::Shell::Get()->screen_orientation_controller();
api::system_display::DisplayProperties info;
info.rotation.reset(new int(90));
@@ -950,10 +950,9 @@
// Entering maximize mode enables accelerometer screen rotations.
EnableMaximizeMode(true);
- ASSERT_FALSE(ash::Shell::GetInstance()
- ->screen_orientation_controller()
- ->rotation_locked());
- ASSERT_FALSE(ash::Shell::GetInstance()
+ ASSERT_FALSE(
+ ash::Shell::Get()->screen_orientation_controller()->rotation_locked());
+ ASSERT_FALSE(ash::Shell::Get()
->screen_orientation_controller()
->user_rotation_locked());
@@ -968,10 +967,9 @@
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
- EXPECT_TRUE(ash::Shell::GetInstance()
- ->screen_orientation_controller()
- ->rotation_locked());
- EXPECT_TRUE(ash::Shell::GetInstance()
+ EXPECT_TRUE(
+ ash::Shell::Get()->screen_orientation_controller()->rotation_locked());
+ EXPECT_TRUE(ash::Shell::Get()
->screen_orientation_controller()
->user_rotation_locked());
}
@@ -1130,8 +1128,7 @@
TEST_F(DisplayInfoProviderChromeosTest, SetOverscanForInternal) {
UpdateDisplay("1200x600,600x1000*2");
const int64_t internal_display_id =
- display::test::DisplayManagerTestApi(
- ash::Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager())
.SetFirstDisplayAsInternalDisplay();
api::system_display::DisplayProperties info;
@@ -1208,8 +1205,7 @@
TEST_F(DisplayInfoProviderChromeosTest, CustomTouchCalibrationInternal) {
UpdateDisplay("1200x600,600x1000*2");
const int64_t internal_display_id =
- display::test::DisplayManagerTestApi(
- ash::Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager())
.SetFirstDisplayAsInternalDisplay();
std::string id = base::Int64ToString(internal_display_id);
@@ -1246,8 +1242,7 @@
UpdateDisplay("1200x600,600x1000*2");
const int64_t internal_display_id =
- display::test::DisplayManagerTestApi(
- ash::Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager())
.SetFirstDisplayAsInternalDisplay();
display::DisplayIdList display_id_list =
@@ -1258,8 +1253,7 @@
? display_id_list[1]
: display_id_list[0];
- display::test::DisplayManagerTestApi(
- ash::Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager())
.SetTouchSupport(display_id, display::Display::TOUCH_SUPPORT_UNAVAILABLE);
std::string id = base::Int64ToString(display_id);
diff --git a/chrome/browser/fullscreen_chromeos.cc b/chrome/browser/fullscreen_chromeos.cc
index 3efdaff..8ceaecd4 100644
--- a/chrome/browser/fullscreen_chromeos.cc
+++ b/chrome/browser/fullscreen_chromeos.cc
@@ -18,7 +18,7 @@
}
for (ash::RootWindowController* controller :
- ash::Shell::GetInstance()->GetAllRootWindowControllers()) {
+ ash::Shell::Get()->GetAllRootWindowControllers()) {
if (display::Screen::GetScreen()
->GetDisplayNearestWindow(controller->GetRootWindow())
.id() == display_id) {
diff --git a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
index 86f8318..4a38ec9 100644
--- a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
+++ b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
@@ -314,7 +314,7 @@
#if defined(OS_CHROMEOS)
screen_id = content::DesktopMediaID::RegisterAuraWindow(
content::DesktopMediaID::TYPE_SCREEN,
- ash::Shell::GetInstance()->GetPrimaryRootWindow());
+ ash::Shell::Get()->GetPrimaryRootWindow());
#else // defined(OS_CHROMEOS)
screen_id = content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN,
webrtc::kFullDesktopScreenId);
diff --git a/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc b/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
index da81ce5..2238ad1f 100644
--- a/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
+++ b/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
@@ -373,9 +373,9 @@
if (IsOriginForCasting(security_origin) && IsVideoMediaType(stream_type)) {
// Notify ash that casting state has changed.
if (state == content::MEDIA_REQUEST_STATE_DONE) {
- ash::Shell::GetInstance()->OnCastingSessionStartedOrStopped(true);
+ ash::Shell::Get()->OnCastingSessionStartedOrStopped(true);
} else if (state == content::MEDIA_REQUEST_STATE_CLOSING) {
- ash::Shell::GetInstance()->OnCastingSessionStartedOrStopped(false);
+ ash::Shell::Get()->OnCastingSessionStartedOrStopped(false);
}
}
#endif
diff --git a/chrome/browser/notifications/login_state_notification_blocker_chromeos.cc b/chrome/browser/notifications/login_state_notification_blocker_chromeos.cc
index cfe8407..d831ecac 100644
--- a/chrome/browser/notifications/login_state_notification_blocker_chromeos.cc
+++ b/chrome/browser/notifications/login_state_notification_blocker_chromeos.cc
@@ -24,7 +24,7 @@
// when running as a mus client (ash::Shell is not initialized when that is
// the case).
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->AddShellObserver(this);
+ ash::Shell::Get()->AddShellObserver(this);
// LoginState may not exist in some tests.
if (chromeos::LoginState::IsInitialized())
@@ -40,7 +40,7 @@
chromeos::LoginState::Get()->RemoveObserver(this);
if (observing_) {
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->RemoveShellObserver(this);
+ ash::Shell::Get()->RemoveShellObserver(this);
chromeos::UserAddingScreen::Get()->RemoveObserver(this);
}
}
@@ -69,7 +69,7 @@
void LoginStateNotificationBlockerChromeOS::OnAppTerminating() {
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->RemoveShellObserver(this);
+ ash::Shell::Get()->RemoveShellObserver(this);
chromeos::UserAddingScreen::Get()->RemoveObserver(this);
observing_ = false;
}
diff --git a/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc b/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc
index e28ed29..d4c0eed 100644
--- a/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc
+++ b/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc
@@ -93,12 +93,12 @@
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
// Lock.
- ash::Shell::GetInstance()->OnLockStateChanged(true);
+ ash::Shell::Get()->OnLockStateChanged(true);
EXPECT_EQ(1, GetStateChangedCountAndReset());
EXPECT_FALSE(ShouldShowNotificationAsPopup(notifier_id));
// Unlock.
- ash::Shell::GetInstance()->OnLockStateChanged(false);
+ ash::Shell::Get()->OnLockStateChanged(false);
EXPECT_EQ(1, GetStateChangedCountAndReset());
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
}
@@ -127,12 +127,12 @@
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
// Lock.
- ash::Shell::GetInstance()->OnLockStateChanged(true);
+ ash::Shell::Get()->OnLockStateChanged(true);
EXPECT_EQ(1, GetStateChangedCountAndReset());
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
// Unlock.
- ash::Shell::GetInstance()->OnLockStateChanged(false);
+ ash::Shell::Get()->OnLockStateChanged(false);
EXPECT_EQ(1, GetStateChangedCountAndReset());
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
}
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc
index 9376d91c..1feebb4 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -291,7 +291,7 @@
#if defined(USE_ASH)
if (ash::Shell::HasInstance()) {
ash::WebNotificationTray* tray =
- ash::Shell::GetInstance()->GetWebNotificationTray();
+ ash::Shell::Get()->GetWebNotificationTray();
if (tray)
tray->GetMessageCenterTray()->HideMessageCenterBubble();
}
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 8a68669..2238c40 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -4145,7 +4145,7 @@
IN_PROC_BROWSER_TEST_F(PolicyTest, UnifiedDesktopEnabledByDefault) {
// Verify that Unified Desktop can be enabled by policy
display::DisplayManager* display_manager =
- ash::Shell::GetInstance()->display_manager();
+ ash::Shell::Get()->display_manager();
// The policy description promises that Unified Desktop is not available
// unless the policy is set (or a command line or an extension is used). If
diff --git a/chrome/browser/renderer_context_menu/open_with_menu_factory_ash.cc b/chrome/browser/renderer_context_menu/open_with_menu_factory_ash.cc
index 6b81537..cf58f91 100644
--- a/chrome/browser/renderer_context_menu/open_with_menu_factory_ash.cc
+++ b/chrome/browser/renderer_context_menu/open_with_menu_factory_ash.cc
@@ -52,7 +52,7 @@
if (!ash::Shell::HasInstance())
return;
ash::LinkHandlerModelFactory* factory =
- ash::Shell::GetInstance()->link_handler_model_factory();
+ ash::Shell::Get()->link_handler_model_factory();
if (!factory)
return;
diff --git a/chrome/browser/ui/ash/ash_init.cc b/chrome/browser/ui/ash/ash_init.cc
index 80c7abd..a35819b6 100644
--- a/chrome/browser/ui/ash/ash_init.cc
+++ b/chrome/browser/ui/ash/ash_init.cc
@@ -104,7 +104,7 @@
else
CreateClassicShell();
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
ash::AcceleratorControllerDelegateAura* accelerator_controller_delegate =
nullptr;
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index 4aa1af7..210e48a 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -103,10 +103,10 @@
class AccessibilityDelegateImpl : public ash::AccessibilityDelegate {
public:
AccessibilityDelegateImpl() {
- ash::Shell::GetInstance()->AddShellObserver(AccessibilityManager::Get());
+ ash::Shell::Get()->AddShellObserver(AccessibilityManager::Get());
}
~AccessibilityDelegateImpl() override {
- ash::Shell::GetInstance()->RemoveShellObserver(AccessibilityManager::Get());
+ ash::Shell::Get()->RemoveShellObserver(AccessibilityManager::Get());
}
void ToggleHighContrast() override {
diff --git a/chrome/browser/ui/ash/launcher/app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/app_window_launcher_controller.cc
index 471c13d..c211d772 100644
--- a/chrome/browser/ui/ash/launcher/app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/app_window_launcher_controller.cc
@@ -13,9 +13,9 @@
ChromeLauncherController* owner)
: owner_(owner) {
if (ash::Shell::HasInstance()) {
- if (ash::Shell::GetInstance()->GetPrimaryRootWindow()) {
+ if (ash::Shell::Get()->GetPrimaryRootWindow()) {
activation_client_ = aura::client::GetActivationClient(
- ash::Shell::GetInstance()->GetPrimaryRootWindow());
+ ash::Shell::Get()->GetPrimaryRootWindow());
if (activation_client_)
activation_client_->AddObserver(this);
}
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
index 0593341..d6e8f2e 100644
--- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
@@ -261,7 +261,7 @@
if (observed_profile_)
StopObserving(observed_profile_);
if (observing_shell_)
- ash::Shell::GetInstance()->RemoveShellObserver(this);
+ ash::Shell::Get()->RemoveShellObserver(this);
}
// static
@@ -395,7 +395,7 @@
// the layout switch information.
if (!observing_shell_) {
observing_shell_ = true;
- ash::Shell::GetInstance()->AddShellObserver(this);
+ ash::Shell::Get()->AddShellObserver(this);
}
// Check if we have controller for this task.
@@ -614,7 +614,7 @@
void ArcAppWindowLauncherController::OnMaximizeModeEnded() {
ash::ScreenOrientationController* orientation_controller =
- ash::Shell::GetInstance()->screen_orientation_controller();
+ ash::Shell::Get()->screen_orientation_controller();
// Don't unlock one by one because it'll switch to next rotation.
orientation_controller->UnlockAll();
}
@@ -724,7 +724,7 @@
ScreenOrientationController::LockCompletionBehavior::DisableSensor;
}
}
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
shell->screen_orientation_controller()->LockOrientationForWindow(
window, BlinkOrientationLockFromMojom(orientation_lock),
lock_completion_behavior);
diff --git a/chrome/browser/ui/ash/launcher/browser_status_monitor.cc b/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
index 1484c08..56d11171 100644
--- a/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
+++ b/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
@@ -82,11 +82,11 @@
: launcher_controller_(launcher_controller),
browser_tab_strip_tracker_(this, this, this) {
DCHECK(launcher_controller_);
- ash::Shell::GetInstance()->activation_client()->AddObserver(this);
+ ash::Shell::Get()->activation_client()->AddObserver(this);
}
BrowserStatusMonitor::~BrowserStatusMonitor() {
- ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
+ ash::Shell::Get()->activation_client()->RemoveObserver(this);
browser_tab_strip_tracker_.StopObservingAndSendOnBrowserRemoved();
}
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
index 18335a31..e3036fa 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
@@ -261,7 +261,7 @@
// Right now ash::Shell isn't created for tests.
// TODO(mukai): Allows it to observe display change and write tests.
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->AddObserver(this);
}
ChromeLauncherControllerImpl::~ChromeLauncherControllerImpl() {
@@ -273,7 +273,7 @@
model_->RemoveObserver(this);
if (ash::Shell::HasInstance())
- ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
for (const auto& pair : id_to_item_controller_map_) {
int index = model_->ItemIndexByID(pair.first);
// A "browser proxy" is not known to the model and this removal does
@@ -571,7 +571,7 @@
ash::Shell::Get()->system_tray_delegate()->ActiveUserWasChanged();
// Force on-screen keyboard to reset.
if (keyboard::IsKeyboardEnabled())
- ash::Shell::GetInstance()->CreateKeyboard();
+ ash::Shell::Get()->CreateKeyboard();
}
void ChromeLauncherControllerImpl::AdditionalUserAddedToSession(
@@ -1166,9 +1166,9 @@
}
const bool is_enabled = keyboard::IsKeyboardEnabled();
if (was_enabled && !is_enabled)
- ash::Shell::GetInstance()->DeactivateKeyboard();
+ ash::Shell::Get()->DeactivateKeyboard();
else if (is_enabled && !was_enabled)
- ash::Shell::GetInstance()->CreateKeyboard();
+ ash::Shell::Get()->CreateKeyboard();
}
ash::ShelfItemStatus ChromeLauncherControllerImpl::GetAppState(
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc
index 4673e68..f52c3f2 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc
@@ -1898,8 +1898,7 @@
// the launcher in the secondary monitor.
IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, MultiDisplayBasicDragAndDrop) {
// Update the display configuration to add a secondary display.
- display::test::DisplayManagerTestApi(
- ash::Shell::GetInstance()->display_manager())
+ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager())
.UpdateDisplay("800x800,801+0-800x800");
// Get a number of interfaces we need.
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
index c14c2e4..1984510f 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
@@ -3819,7 +3819,7 @@
AddArcAppAndShortcut(appinfo_current_);
ash::ScreenOrientationController* controller =
- ash::Shell::GetInstance()->screen_orientation_controller();
+ ash::Shell::Get()->screen_orientation_controller();
// Creating a window with NONE orientation will not lock the screen.
window_none_ = CreateArcWindow(window_app_id_none_);
@@ -3908,7 +3908,7 @@
InitLauncherController();
ash::ScreenOrientationController* controller =
- ash::Shell::GetInstance()->screen_orientation_controller();
+ ash::Shell::Get()->screen_orientation_controller();
std::string app_id1("org.chromium.arc.1");
int task_id1 = 1;
@@ -3959,7 +3959,7 @@
InitApps();
ash::ScreenOrientationController* controller =
- ash::Shell::GetInstance()->screen_orientation_controller();
+ ash::Shell::Get()->screen_orientation_controller();
// Activating a window with NON orientation unlocks the screen.
window_none_->Activate();
diff --git a/chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.cc b/chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.cc
index 0946c87..5a2d032 100644
--- a/chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.cc
+++ b/chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.cc
@@ -246,7 +246,7 @@
// Note: The animation duration override will be set before the old user gets
// hidden and reset after the animations for the new user got kicked off.
ash::Shell::RootWindowControllerList controller =
- ash::Shell::GetInstance()->GetAllRootWindowControllers();
+ ash::Shell::Get()->GetAllRootWindowControllers();
for (ash::Shell::RootWindowControllerList::iterator iter = controller.begin();
iter != controller.end(); ++iter) {
(*iter)->GetShelfLayoutManager()->SetAnimationDurationOverride(
diff --git a/chrome/browser/ui/ash/multi_user/user_switch_util.cc b/chrome/browser/ui/ash/multi_user/user_switch_util.cc
index 693d012..af1efe7 100644
--- a/chrome/browser/ui/ash/multi_user/user_switch_util.cc
+++ b/chrome/browser/ui/ash/multi_user/user_switch_util.cc
@@ -27,8 +27,7 @@
// If neither screen sharing nor capturing is going on we can immediately
// switch users.
- ash::SystemTray* system_tray =
- ash::Shell::GetInstance()->GetPrimarySystemTray();
+ ash::SystemTray* system_tray = ash::Shell::Get()->GetPrimarySystemTray();
if (!system_tray->GetScreenShareItem()->is_started() &&
!system_tray->GetScreenCaptureItem()->is_started()) {
on_switch.Run();
@@ -39,8 +38,7 @@
l10n_util::GetStringUTF16(IDS_DESKTOP_CASTING_ACTIVE_MESSAGE)) ==
chrome::MESSAGE_BOX_RESULT_YES) {
// Stop screen sharing and capturing.
- ash::SystemTray* system_tray =
- ash::Shell::GetInstance()->GetPrimarySystemTray();
+ ash::SystemTray* system_tray = ash::Shell::Get()->GetPrimarySystemTray();
if (system_tray->GetScreenShareItem()->is_started())
system_tray->GetScreenShareItem()->Stop();
if (system_tray->GetScreenCaptureItem()->is_started())
diff --git a/chrome/browser/ui/ash/palette_delegate_chromeos.cc b/chrome/browser/ui/ash/palette_delegate_chromeos.cc
index d69e959..5d8c7713 100644
--- a/chrome/browser/ui/ash/palette_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/palette_delegate_chromeos.cc
@@ -140,8 +140,7 @@
}
void PaletteDelegateChromeOS::TakePartialScreenshot(const base::Closure& done) {
- auto* screenshot_controller =
- ash::Shell::GetInstance()->screenshot_controller();
+ auto* screenshot_controller = ash::Shell::Get()->screenshot_controller();
auto* screenshot_delegate = ash::WmShellAura::Get()
->accelerator_controller_delegate()
->screenshot_delegate();
@@ -155,7 +154,7 @@
}
void PaletteDelegateChromeOS::CancelPartialScreenshot() {
- ash::Shell::GetInstance()->screenshot_controller()->CancelScreenshotSession();
+ ash::Shell::Get()->screenshot_controller()->CancelScreenshotSession();
}
} // namespace chromeos
diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos_browsertest_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos_browsertest_chromeos.cc
index 63719e5..69482974 100644
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos_browsertest_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos_browsertest_chromeos.cc
@@ -36,9 +36,7 @@
base::HourClockType GetHourType() {
const ash::TraySystemInfo* tray_system_info =
- ash::Shell::GetInstance()
- ->GetPrimarySystemTray()
- ->GetTraySystemInfoForTesting();
+ ash::Shell::Get()->GetPrimarySystemTray()->GetTraySystemInfoForTesting();
const ash::SystemInfoDefaultView* system_info_default_view =
tray_system_info->GetDefaultViewForTesting();
@@ -46,9 +44,8 @@
}
void CreateDefaultView() {
- ash::TraySystemInfo* tray_system_info = ash::Shell::GetInstance()
- ->GetPrimarySystemTray()
- ->GetTraySystemInfoForTesting();
+ ash::TraySystemInfo* tray_system_info =
+ ash::Shell::Get()->GetPrimarySystemTray()->GetTraySystemInfoForTesting();
tray_system_info->CreateDefaultViewForTesting(
ash::LoginStatus::NOT_LOGGED_IN);
}
diff --git a/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc b/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc
index eb20ef7..f3f5881 100644
--- a/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc
@@ -41,7 +41,7 @@
// Returns the cast tray instance.
ash::TrayCast* GetTrayCast() {
- ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
+ ash::SystemTray* tray = ash::Shell::Get()->GetPrimarySystemTray();
// Make sure we actually popup the tray, otherwise the TrayCast instance will
// not be created.
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc
index 8c0004a3..1215ac5f 100644
--- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc
+++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc
@@ -344,7 +344,7 @@
AppWindow::FULLSCREEN_TYPE_OS);
if (!ash_util::IsRunningInMash()) {
DCHECK(ash::Shell::HasInstance());
- ash::Shell::GetInstance()->UpdateShelfVisibility();
+ ash::Shell::Get()->UpdateShelfVisibility();
}
}
}
diff --git a/chrome/browser/ui/views/ash/tab_scrubber.cc b/chrome/browser/ui/views/ash/tab_scrubber.cc
index 091949d..641250e 100644
--- a/chrome/browser/ui/views/ash/tab_scrubber.cc
+++ b/chrome/browser/ui/views/ash/tab_scrubber.cc
@@ -76,7 +76,7 @@
activation_delay_(kActivationDelayMS),
use_default_activation_delay_(true),
weak_ptr_factory_(this) {
- ash::Shell::GetInstance()->AddPreTargetHandler(this);
+ ash::Shell::Get()->AddPreTargetHandler(this);
registrar_.Add(
this,
chrome::NOTIFICATION_BROWSER_CLOSED,
diff --git a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
index 012191c..8e484e30 100644
--- a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
+++ b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
@@ -98,7 +98,7 @@
TabScrubber::GetInstance()->set_activation_delay(0);
// Disable external monitor scaling of coordinates.
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
shell->event_transformation_handler()->set_transformation_mode(
ash::EventTransformationHandler::TRANSFORM_NONE);
}
diff --git a/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc b/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc
index 8057319..523d8d85 100644
--- a/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc
@@ -52,7 +52,7 @@
views::NonClientFrameView* ChromeViewsDelegate::CreateDefaultNonClientFrameView(
views::Widget* widget) {
- return ash::Shell::GetInstance()->CreateDefaultNonClientFrameView(widget);
+ return ash::Shell::Get()->CreateDefaultNonClientFrameView(widget);
}
void ChromeViewsDelegate::AdjustSavedWindowPlacementChromeOS(
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
index c625c9f..1f6282e6 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -77,11 +77,11 @@
window_icon_(nullptr) {
ash::WmWindow::Get(frame->GetNativeWindow())
->InstallResizeHandleWindowTargeter(nullptr);
- ash::Shell::GetInstance()->AddShellObserver(this);
+ ash::Shell::Get()->AddShellObserver(this);
}
BrowserNonClientFrameViewAsh::~BrowserNonClientFrameViewAsh() {
- ash::Shell::GetInstance()->RemoveShellObserver(this);
+ ash::Shell::Get()->RemoveShellObserver(this);
}
void BrowserNonClientFrameViewAsh::Init() {
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
index 6525d653..a582e52d 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
@@ -344,7 +344,7 @@
IsWindowFullscreenForTabOrPending();
ash::wm::GetWindowState(native_window_)
->set_hide_shelf_when_fullscreen(in_tab_fullscreen);
- ash::Shell::GetInstance()->UpdateShelfVisibility();
+ ash::Shell::Get()->UpdateShelfVisibility();
}
void ImmersiveModeControllerAsh::OnWindowPropertyChanged(aura::Window* window,
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
index e3401019..c2ee35b 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -2161,7 +2161,7 @@
float GetCursorDeviceScaleFactor() const {
ash::test::CursorManagerTestApi cursor_test_api(
- ash::Shell::GetInstance()->cursor_manager());
+ ash::Shell::Get()->cursor_manager());
return cursor_test_api.GetCurrentCursor().device_scale_factor();
}
@@ -2292,7 +2292,7 @@
// Switching display mode should cancel the drag operation.
display::DisplayManager* display_manager =
- ash::Shell::GetInstance()->display_manager();
+ ash::Shell::Get()->display_manager();
display_manager->AddRemoveDisplay();
}
diff --git a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
index e55d711..c578db1 100644
--- a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
@@ -310,7 +310,7 @@
chromeos::switches::kHasChromeOSDiamondKey));
source->AddBoolean("keyboardOverlayTopRowKeysAreFunctionKeys",
TopRowKeysAreFunctionKeys(profile));
- ash::Shell* shell = ash::Shell::GetInstance();
+ ash::Shell* shell = ash::Shell::Get();
display::DisplayManager* display_manager = shell->display_manager();
source->AddBoolean("keyboardOverlayIsDisplayUIScalingEnabled",
display_manager->IsDisplayUIScalingEnabled());
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
index d8ae077..097c8742 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -1227,7 +1227,7 @@
}
void SigninScreenHandler::HandleShutdownSystem() {
- ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown();
+ ash::Shell::Get()->lock_state_controller()->RequestShutdown();
}
void SigninScreenHandler::HandleLoadWallpaper(const AccountId& account_id) {
diff --git a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
index 297d54326..f6348dd 100644
--- a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
@@ -43,11 +43,11 @@
namespace {
display::DisplayManager* GetDisplayManager() {
- return ash::Shell::GetInstance()->display_manager();
+ return ash::Shell::Get()->display_manager();
}
ash::DisplayConfigurationController* GetDisplayConfigurationController() {
- return ash::Shell::GetInstance()->display_configuration_controller();
+ return ash::Shell::Get()->display_configuration_controller();
}
int64_t GetDisplayIdFromValue(const base::Value* arg) {
@@ -196,13 +196,13 @@
DisplayOptionsHandler::DisplayOptionsHandler() {
// TODO(mash) Support Chrome display settings in Mash. crbug.com/548429
if (!ash_util::IsRunningInMash())
- ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->AddObserver(this);
}
DisplayOptionsHandler::~DisplayOptionsHandler() {
// TODO(mash) Support Chrome display settings in Mash. crbug.com/548429
if (!ash_util::IsRunningInMash())
- ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
+ ash::Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
}
void DisplayOptionsHandler::GetLocalizedValues(
@@ -500,10 +500,8 @@
return;
// For external displays, show a notification confirming the resolution
// change.
- ash::Shell::GetInstance()
- ->resolution_notification_controller()
- ->PrepareNotification(display_id, current_mode, mode,
- base::Bind(&chromeos::StoreDisplayPrefs));
+ ash::Shell::Get()->resolution_notification_controller()->PrepareNotification(
+ display_id, current_mode, mode, base::Bind(&chromeos::StoreDisplayPrefs));
}
void DisplayOptionsHandler::HandleSetRotation(const base::ListValue* args) {
diff --git a/chrome/browser/ui/webui/options/chromeos/display_overscan_handler.cc b/chrome/browser/ui/webui/options/chromeos/display_overscan_handler.cc
index f3f496c9..9616d7e 100644
--- a/chrome/browser/ui/webui/options/chromeos/display_overscan_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/display_overscan_handler.cc
@@ -118,13 +118,13 @@
}
const display::Display& display =
- ash::Shell::GetInstance()->display_manager()->GetDisplayForId(display_id);
+ ash::Shell::Get()->display_manager()->GetDisplayForId(display_id);
DCHECK(display.is_valid());
if (!display.is_valid())
return;
ash::WindowTreeHostManager* window_tree_host_manager =
- ash::Shell::GetInstance()->window_tree_host_manager();
+ ash::Shell::Get()->window_tree_host_manager();
overscan_calibrator_.reset(new OverscanCalibrator(
display, window_tree_host_manager->GetOverscanInsets(display_id)));
}
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash.cc b/chrome/browser/ui/window_sizer/window_sizer_ash.cc
index 89c18ebe8..35c4a7d 100644
--- a/chrome/browser/ui/window_sizer/window_sizer_ash.cc
+++ b/chrome/browser/ui/window_sizer/window_sizer_ash.cc
@@ -46,8 +46,7 @@
// In case of a popup with an 'unspecified' location in ash, we are
// looking for a good screen location. We are interpreting (0,0) as an
// unspecified location.
- *bounds = ash::Shell::GetInstance()->window_positioner()->
- GetPopupPosition(*bounds);
+ *bounds = ash::Shell::Get()->window_positioner()->GetPopupPosition(*bounds);
determined = true;
}
diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.cc b/components/arc/intent_helper/arc_intent_helper_bridge.cc
index 64bbc00..3d556d1a 100644
--- a/components/arc/intent_helper/arc_intent_helper_bridge.cc
+++ b/components/arc/intent_helper/arc_intent_helper_bridge.cc
@@ -46,7 +46,7 @@
void ArcIntentHelperBridge::OnInstanceReady() {
DCHECK(thread_checker_.CalledOnValidThread());
- ash::Shell::GetInstance()->set_link_handler_model_factory(this);
+ ash::Shell::Get()->set_link_handler_model_factory(this);
auto* instance =
ARC_GET_INSTANCE_FOR_METHOD(arc_bridge_service()->intent_helper(), Init);
DCHECK(instance);
@@ -55,7 +55,7 @@
void ArcIntentHelperBridge::OnInstanceClosed() {
DCHECK(thread_checker_.CalledOnValidThread());
- ash::Shell::GetInstance()->set_link_handler_model_factory(nullptr);
+ ash::Shell::Get()->set_link_handler_model_factory(nullptr);
}
void ArcIntentHelperBridge::OnIconInvalidated(const std::string& package_name) {
@@ -79,7 +79,7 @@
void ArcIntentHelperBridge::OpenWallpaperPicker() {
DCHECK(thread_checker_.CalledOnValidThread());
- ash::Shell::GetInstance()->wallpaper_controller()->OpenSetWallpaperPage();
+ ash::Shell::Get()->wallpaper_controller()->OpenSetWallpaperPage();
}
void ArcIntentHelperBridge::SetWallpaperDeprecated(
diff --git a/components/arc/power/arc_power_bridge.cc b/components/arc/power/arc_power_bridge.cc
index a9a47f52..ec4906f 100644
--- a/components/arc/power/arc_power_bridge.cc
+++ b/components/arc/power/arc_power_bridge.cc
@@ -31,13 +31,13 @@
ARC_GET_INSTANCE_FOR_METHOD(arc_bridge_service()->power(), Init);
DCHECK(power_instance);
power_instance->Init(binding_.CreateInterfacePtrAndBind());
- ash::Shell::GetInstance()->display_configurator()->AddObserver(this);
+ ash::Shell::Get()->display_configurator()->AddObserver(this);
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
AddObserver(this);
}
void ArcPowerBridge::OnInstanceClosed() {
- ash::Shell::GetInstance()->display_configurator()->RemoveObserver(this);
+ ash::Shell::Get()->display_configurator()->RemoveObserver(this);
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
RemoveObserver(this);
ReleaseAllDisplayWakeLocks();
@@ -122,8 +122,7 @@
}
void ArcPowerBridge::IsDisplayOn(const IsDisplayOnCallback& callback) {
- callback.Run(
- ash::Shell::GetInstance()->display_configurator()->IsDisplayOn());
+ callback.Run(ash::Shell::Get()->display_configurator()->IsDisplayOn());
}
void ArcPowerBridge::ReleaseAllDisplayWakeLocks() {
diff --git a/components/exo/shell_surface_unittest.cc b/components/exo/shell_surface_unittest.cc
index 8b9d742..1225ab0 100644
--- a/components/exo/shell_surface_unittest.cc
+++ b/components/exo/shell_surface_unittest.cc
@@ -966,7 +966,7 @@
EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(shell_window, ev_out));
// Enable spoken feedback.
- ash::Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback(
+ ash::Shell::Get()->accessibility_delegate()->ToggleSpokenFeedback(
ash::A11Y_NOTIFICATION_NONE);
shell_surface.OnAccessibilityModeChanged();
@@ -1003,7 +1003,7 @@
EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
// Disable spoken feedback. Shadow underlay is restored.
- ash::Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback(
+ ash::Shell::Get()->accessibility_delegate()->ToggleSpokenFeedback(
ash::A11Y_NOTIFICATION_NONE);
shell_surface.OnAccessibilityModeChanged();
shell_surface2.OnAccessibilityModeChanged();
diff --git a/components/exo/wm_helper_ash.cc b/components/exo/wm_helper_ash.cc
index 60f8119..738a040 100644
--- a/components/exo/wm_helper_ash.cc
+++ b/components/exo/wm_helper_ash.cc
@@ -21,9 +21,9 @@
// WMHelperAsh, public:
WMHelperAsh::WMHelperAsh() {
- ash::Shell::GetInstance()->AddShellObserver(this);
- ash::Shell::GetInstance()->activation_client()->AddObserver(this);
- ash::Shell::GetInstance()->cursor_manager()->AddObserver(this);
+ ash::Shell::Get()->AddShellObserver(this);
+ ash::Shell::Get()->activation_client()->AddObserver(this);
+ ash::Shell::Get()->cursor_manager()->AddObserver(this);
ash::WmShell::Get()->AddDisplayObserver(this);
aura::client::FocusClient* focus_client =
aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow());
@@ -39,9 +39,9 @@
aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow());
focus_client->RemoveObserver(this);
ash::WmShell::Get()->RemoveDisplayObserver(this);
- ash::Shell::GetInstance()->cursor_manager()->RemoveObserver(this);
- ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
- ash::Shell::GetInstance()->RemoveShellObserver(this);
+ ash::Shell::Get()->cursor_manager()->RemoveObserver(this);
+ ash::Shell::Get()->activation_client()->RemoveObserver(this);
+ ash::Shell::Get()->RemoveShellObserver(this);
ui::DeviceDataManager::GetInstance()->RemoveObserver(this);
ash::Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this);
}
@@ -51,8 +51,7 @@
const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo(
int64_t display_id) const {
- return ash::Shell::GetInstance()->display_manager()->GetDisplayInfo(
- display_id);
+ return ash::Shell::Get()->display_manager()->GetDisplayInfo(display_id);
}
aura::Window* WMHelperAsh::GetContainer(int container_id) {
@@ -61,7 +60,7 @@
}
aura::Window* WMHelperAsh::GetActiveWindow() const {
- return ash::Shell::GetInstance()->activation_client()->GetActiveWindow();
+ return ash::Shell::Get()->activation_client()->GetActiveWindow();
}
aura::Window* WMHelperAsh::GetFocusedWindow() const {
@@ -71,27 +70,27 @@
}
ui::CursorSetType WMHelperAsh::GetCursorSet() const {
- return ash::Shell::GetInstance()->cursor_manager()->GetCursorSet();
+ return ash::Shell::Get()->cursor_manager()->GetCursorSet();
}
void WMHelperAsh::AddPreTargetHandler(ui::EventHandler* handler) {
- ash::Shell::GetInstance()->AddPreTargetHandler(handler);
+ ash::Shell::Get()->AddPreTargetHandler(handler);
}
void WMHelperAsh::PrependPreTargetHandler(ui::EventHandler* handler) {
- ash::Shell::GetInstance()->PrependPreTargetHandler(handler);
+ ash::Shell::Get()->PrependPreTargetHandler(handler);
}
void WMHelperAsh::RemovePreTargetHandler(ui::EventHandler* handler) {
- ash::Shell::GetInstance()->RemovePreTargetHandler(handler);
+ ash::Shell::Get()->RemovePreTargetHandler(handler);
}
void WMHelperAsh::AddPostTargetHandler(ui::EventHandler* handler) {
- ash::Shell::GetInstance()->AddPostTargetHandler(handler);
+ ash::Shell::Get()->AddPostTargetHandler(handler);
}
void WMHelperAsh::RemovePostTargetHandler(ui::EventHandler* handler) {
- ash::Shell::GetInstance()->RemovePostTargetHandler(handler);
+ ash::Shell::Get()->RemovePostTargetHandler(handler);
}
bool WMHelperAsh::IsMaximizeModeWindowManagerEnabled() const {
@@ -101,14 +100,11 @@
}
bool WMHelperAsh::IsSpokenFeedbackEnabled() const {
- return ash::Shell::GetInstance()
- ->accessibility_delegate()
- ->IsSpokenFeedbackEnabled();
+ return ash::Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled();
}
void WMHelperAsh::PlayEarcon(int sound_key) const {
- return ash::Shell::GetInstance()->accessibility_delegate()->PlayEarcon(
- sound_key);
+ return ash::Shell::Get()->accessibility_delegate()->PlayEarcon(sound_key);
}
void WMHelperAsh::OnWindowActivated(
diff --git a/ui/arc/notification/arc_notification_manager.cc b/ui/arc/notification/arc_notification_manager.cc
index 5d421c3..f25d8f7d 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -273,12 +273,12 @@
base::UTF8ToUTF16(data->text.has_value() ? *data->text : std::string()));
const base::string16 dismiss_text16(base::UTF8ToUTF16(
data->dismiss_text.has_value() ? *data->dismiss_text : std::string()));
- ash::Shell::GetInstance()->toast_manager()->Show(
+ ash::Shell::Get()->toast_manager()->Show(
ash::ToastData(data->id, text16, data->duration, dismiss_text16));
}
void ArcNotificationManager::OnToastCancelled(mojom::ArcToastDataPtr data) {
- ash::Shell::GetInstance()->toast_manager()->Cancel(data->id);
+ ash::Shell::Get()->toast_manager()->Cancel(data->id);
}
} // namespace arc