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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 switches::kEnablePanels) || | 81 switches::kEnablePanels) || |
82 extension_id == std::string("nckgahadagoaajjgafhacjanaoiihapd") || | 82 extension_id == std::string("nckgahadagoaajjgafhacjanaoiihapd") || |
83 extension_id == std::string("ljclpkphhpbpinifbeabbhlfddcpfdde") || | 83 extension_id == std::string("ljclpkphhpbpinifbeabbhlfddcpfdde") || |
84 extension_id == std::string("ppleadejekpmccmnpjdimmlfljlkdfej") || | 84 extension_id == std::string("ppleadejekpmccmnpjdimmlfljlkdfej") || |
85 extension_id == std::string("eggnbpckecmjlblplehfpjjdhhidfdoj"); | 85 extension_id == std::string("eggnbpckecmjlblplehfpjjdhhidfdoj"); |
86 } | 86 } |
87 | 87 |
88 return true; | 88 return true; |
89 } | 89 } |
90 | 90 |
| 91 // static |
| 92 bool PanelManager::UseBrowserlessPanels() { |
| 93 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kOldPanels)) |
| 94 return false; |
| 95 |
| 96 return chrome::VersionInfo::GetChannel() <= chrome::VersionInfo::CHANNEL_DEV; |
| 97 } |
| 98 |
91 PanelManager::PanelManager() | 99 PanelManager::PanelManager() |
92 : panel_mouse_watcher_(PanelMouseWatcher::Create()), | 100 : panel_mouse_watcher_(PanelMouseWatcher::Create()), |
93 auto_sizing_enabled_(true) { | 101 auto_sizing_enabled_(true) { |
94 // DisplaySettingsProvider should be created before the creation of strips | 102 // DisplaySettingsProvider should be created before the creation of strips |
95 // since some strip might depend on it. | 103 // since some strip might depend on it. |
96 display_settings_provider_.reset(DisplaySettingsProvider::Create()); | 104 display_settings_provider_.reset(DisplaySettingsProvider::Create()); |
97 display_settings_provider_->AddDisplayAreaObserver(this); | 105 display_settings_provider_->AddDisplayAreaObserver(this); |
98 | 106 |
99 detached_strip_.reset(new DetachedPanelStrip(this)); | 107 detached_strip_.reset(new DetachedPanelStrip(this)); |
100 docked_strip_.reset(new DockedPanelStrip(this)); | 108 docked_strip_.reset(new DockedPanelStrip(this)); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { | 356 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { |
349 panel_mouse_watcher_.reset(watcher); | 357 panel_mouse_watcher_.reset(watcher); |
350 } | 358 } |
351 | 359 |
352 void PanelManager::OnPanelAnimationEnded(Panel* panel) { | 360 void PanelManager::OnPanelAnimationEnded(Panel* panel) { |
353 content::NotificationService::current()->Notify( | 361 content::NotificationService::current()->Notify( |
354 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 362 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
355 content::Source<Panel>(panel), | 363 content::Source<Panel>(panel), |
356 content::NotificationService::NoDetails()); | 364 content::NotificationService::NoDetails()); |
357 } | 365 } |
OLD | NEW |