Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/panels/panel_manager.h" | 5 #include "chrome/browser/ui/panels/panel_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 } | 100 } |
| 101 | 101 |
| 102 // static | 102 // static |
| 103 void PanelManager::SetDisplaySettingsProviderForTesting( | 103 void PanelManager::SetDisplaySettingsProviderForTesting( |
| 104 DisplaySettingsProvider* provider) { | 104 DisplaySettingsProvider* provider) { |
| 105 display_settings_provider_for_testing = provider; | 105 display_settings_provider_for_testing = provider; |
| 106 } | 106 } |
| 107 | 107 |
| 108 // static | 108 // static |
| 109 bool PanelManager::ShouldUsePanels(const std::string& extension_id) { | 109 bool PanelManager::ShouldUsePanels(const std::string& extension_id) { |
| 110 // If --disable-panels is on, never use panels. | |
| 111 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 112 switches::kDisablePanels)) | |
|
Evan Stade
2016/06/21 21:18:23
Did you consider leaving the flags alone and just
Dmitry Titov
2016/06/22 00:29:28
Done, keep switches working for now, changing defa
| |
| 113 return false; | |
| 114 | |
| 115 // If --enable-panels is on, always use panels. | 110 // If --enable-panels is on, always use panels. |
| 116 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 111 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 117 switches::kEnablePanels)) | 112 switches::kEnablePanels)) |
| 118 return true; | 113 return true; |
| 119 | 114 |
| 115 // Panels are an Eraser target. See http://crbug.com/571511 for details. | |
| 116 // TODO(dimich): remove the rest of Panels code once erasure is stable. | |
| 117 #if !defined(OS_CHROMEOS) | |
| 118 return false; | |
| 119 #endif // !OS_CHROMEOS | |
| 120 | |
| 120 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 121 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 121 // On Linux, panels are only supported on tested window managers. | 122 // On Linux, panels are only supported on tested window managers. |
| 122 ui::WindowManagerName wm_type = ui::GuessWindowManager(); | 123 ui::WindowManagerName wm_type = ui::GuessWindowManager(); |
| 123 if (wm_type != ui::WM_COMPIZ && | 124 if (wm_type != ui::WM_COMPIZ && |
| 124 wm_type != ui::WM_ICE_WM && | 125 wm_type != ui::WM_ICE_WM && |
| 125 wm_type != ui::WM_KWIN && | 126 wm_type != ui::WM_KWIN && |
| 126 wm_type != ui::WM_METACITY && | 127 wm_type != ui::WM_METACITY && |
| 127 wm_type != ui::WM_MUFFIN && | 128 wm_type != ui::WM_MUFFIN && |
| 128 wm_type != ui::WM_MUTTER && | 129 wm_type != ui::WM_MUTTER && |
| 129 wm_type != ui::WM_XFWM4) { | 130 wm_type != ui::WM_XFWM4) { |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { | 570 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { |
| 570 panel_mouse_watcher_.reset(watcher); | 571 panel_mouse_watcher_.reset(watcher); |
| 571 } | 572 } |
| 572 | 573 |
| 573 void PanelManager::OnPanelAnimationEnded(Panel* panel) { | 574 void PanelManager::OnPanelAnimationEnded(Panel* panel) { |
| 574 content::NotificationService::current()->Notify( | 575 content::NotificationService::current()->Notify( |
| 575 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 576 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
| 576 content::Source<Panel>(panel), | 577 content::Source<Panel>(panel), |
| 577 content::NotificationService::NoDetails()); | 578 content::NotificationService::NoDetails()); |
| 578 } | 579 } |
| OLD | NEW |