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> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
9 #include "base/logging.h" | 11 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/ui/panels/detached_panel_collection.h" | 15 #include "chrome/browser/ui/panels/detached_panel_collection.h" |
15 #include "chrome/browser/ui/panels/docked_panel_collection.h" | 16 #include "chrome/browser/ui/panels/docked_panel_collection.h" |
16 #include "chrome/browser/ui/panels/panel_drag_controller.h" | 17 #include "chrome/browser/ui/panels/panel_drag_controller.h" |
17 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" | 18 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
18 #include "chrome/browser/ui/panels/panel_resize_controller.h" | 19 #include "chrome/browser/ui/panels/panel_resize_controller.h" |
19 #include "chrome/browser/ui/panels/stacked_panel_collection.h" | 20 #include "chrome/browser/ui/panels/stacked_panel_collection.h" |
20 #include "chrome/common/channel_info.h" | 21 #include "chrome/common/channel_info.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return true; | 149 return true; |
149 #endif | 150 #endif |
150 } | 151 } |
151 | 152 |
152 // static | 153 // static |
153 bool PanelManager::CanUseSystemMinimize() { | 154 bool PanelManager::CanUseSystemMinimize() { |
154 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 155 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
155 static base::nix::DesktopEnvironment desktop_env = | 156 static base::nix::DesktopEnvironment desktop_env = |
156 base::nix::DESKTOP_ENVIRONMENT_OTHER; | 157 base::nix::DESKTOP_ENVIRONMENT_OTHER; |
157 if (desktop_env == base::nix::DESKTOP_ENVIRONMENT_OTHER) { | 158 if (desktop_env == base::nix::DESKTOP_ENVIRONMENT_OTHER) { |
158 scoped_ptr<base::Environment> env(base::Environment::Create()); | 159 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
159 desktop_env = base::nix::GetDesktopEnvironment(env.get()); | 160 desktop_env = base::nix::GetDesktopEnvironment(env.get()); |
160 } | 161 } |
161 return desktop_env != base::nix::DESKTOP_ENVIRONMENT_UNITY; | 162 return desktop_env != base::nix::DESKTOP_ENVIRONMENT_UNITY; |
162 #else | 163 #else |
163 return true; | 164 return true; |
164 #endif | 165 #endif |
165 } | 166 } |
166 | 167 |
167 PanelManager::PanelManager() | 168 PanelManager::PanelManager() |
168 : panel_mouse_watcher_(PanelMouseWatcher::Create()), | 169 : panel_mouse_watcher_(PanelMouseWatcher::Create()), |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { | 569 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { |
569 panel_mouse_watcher_.reset(watcher); | 570 panel_mouse_watcher_.reset(watcher); |
570 } | 571 } |
571 | 572 |
572 void PanelManager::OnPanelAnimationEnded(Panel* panel) { | 573 void PanelManager::OnPanelAnimationEnded(Panel* panel) { |
573 content::NotificationService::current()->Notify( | 574 content::NotificationService::current()->Notify( |
574 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 575 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
575 content::Source<Panel>(panel), | 576 content::Source<Panel>(panel), |
576 content::NotificationService::NoDetails()); | 577 content::NotificationService::NoDetails()); |
577 } | 578 } |
OLD | NEW |