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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 return true; | 88 return true; |
89 } | 89 } |
90 | 90 |
91 // static | 91 // static |
92 bool PanelManager::UseBrowserlessPanels() { | 92 bool PanelManager::UseBrowserlessPanels() { |
93 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kOldPanels)) | 93 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kOldPanels)) |
94 return false; | 94 return false; |
95 | 95 |
96 return chrome::VersionInfo::GetChannel() <= | 96 // http://crbug.com/143506 |
97 chrome::VersionInfo::CHANNEL_UNKNOWN; | 97 // TODO(jennb): Remove after channel check can be used. |
| 98 // return chrome::VersionInfo::GetChannel() <= chrome::VersionInfo::CHANNEL_DEV; |
| 99 // For now, use former flag to turn on browserless panels. |
| 100 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kBrowserlessPanels)) |
| 101 return true; |
| 102 |
| 103 return false; |
98 } | 104 } |
99 | 105 |
100 PanelManager::PanelManager() | 106 PanelManager::PanelManager() |
101 : panel_mouse_watcher_(PanelMouseWatcher::Create()), | 107 : panel_mouse_watcher_(PanelMouseWatcher::Create()), |
102 auto_sizing_enabled_(true) { | 108 auto_sizing_enabled_(true) { |
103 // DisplaySettingsProvider should be created before the creation of strips | 109 // DisplaySettingsProvider should be created before the creation of strips |
104 // since some strip might depend on it. | 110 // since some strip might depend on it. |
105 display_settings_provider_.reset(DisplaySettingsProvider::Create()); | 111 display_settings_provider_.reset(DisplaySettingsProvider::Create()); |
106 display_settings_provider_->AddDisplayAreaObserver(this); | 112 display_settings_provider_->AddDisplayAreaObserver(this); |
107 | 113 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { | 363 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { |
358 panel_mouse_watcher_.reset(watcher); | 364 panel_mouse_watcher_.reset(watcher); |
359 } | 365 } |
360 | 366 |
361 void PanelManager::OnPanelAnimationEnded(Panel* panel) { | 367 void PanelManager::OnPanelAnimationEnded(Panel* panel) { |
362 content::NotificationService::current()->Notify( | 368 content::NotificationService::current()->Notify( |
363 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 369 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
364 content::Source<Panel>(panel), | 370 content::Source<Panel>(panel), |
365 content::NotificationService::NoDetails()); | 371 content::NotificationService::NoDetails()); |
366 } | 372 } |
OLD | NEW |