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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 | 99 |
100 // static | 100 // static |
101 void PanelManager::SetDisplaySettingsProviderForTesting( | 101 void PanelManager::SetDisplaySettingsProviderForTesting( |
102 DisplaySettingsProvider* provider) { | 102 DisplaySettingsProvider* provider) { |
103 display_settings_provider_for_testing = provider; | 103 display_settings_provider_for_testing = provider; |
104 } | 104 } |
105 | 105 |
106 // static | 106 // static |
107 bool PanelManager::ShouldUsePanels(const std::string& extension_id) { | 107 bool PanelManager::ShouldUsePanels(const std::string& extension_id) { |
| 108 // If --disable-panels is on, never use panels. |
| 109 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 110 switches::kDisablePanels)) |
| 111 return false; |
| 112 |
108 // If --enable-panels is on, always use panels. | 113 // If --enable-panels is on, always use panels. |
109 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 114 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
110 switches::kEnablePanels)) | 115 switches::kEnablePanels)) |
111 return true; | 116 return true; |
112 | 117 |
113 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 118 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
114 // On Linux, panels are only supported on tested window managers. | 119 // On Linux, panels are only supported on tested window managers. |
115 ui::WindowManagerName wm_type = ui::GuessWindowManager(); | 120 ui::WindowManagerName wm_type = ui::GuessWindowManager(); |
116 if (wm_type != ui::WM_COMPIZ && | 121 if (wm_type != ui::WM_COMPIZ && |
117 wm_type != ui::WM_ICE_WM && | 122 wm_type != ui::WM_ICE_WM && |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { | 575 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { |
571 panel_mouse_watcher_.reset(watcher); | 576 panel_mouse_watcher_.reset(watcher); |
572 } | 577 } |
573 | 578 |
574 void PanelManager::OnPanelAnimationEnded(Panel* panel) { | 579 void PanelManager::OnPanelAnimationEnded(Panel* panel) { |
575 content::NotificationService::current()->Notify( | 580 content::NotificationService::current()->Notify( |
576 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 581 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
577 content::Source<Panel>(panel), | 582 content::Source<Panel>(panel), |
578 content::NotificationService::NoDetails()); | 583 content::NotificationService::NoDetails()); |
579 } | 584 } |
OLD | NEW |