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" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
13 #include "chrome/browser/ui/panels/detached_panel_collection.h" | 13 #include "chrome/browser/ui/panels/detached_panel_collection.h" |
14 #include "chrome/browser/ui/panels/docked_panel_collection.h" | 14 #include "chrome/browser/ui/panels/docked_panel_collection.h" |
15 #include "chrome/browser/ui/panels/panel_drag_controller.h" | 15 #include "chrome/browser/ui/panels/panel_drag_controller.h" |
16 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" | 16 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
17 #include "chrome/browser/ui/panels/panel_resize_controller.h" | 17 #include "chrome/browser/ui/panels/panel_resize_controller.h" |
18 #include "chrome/browser/ui/panels/stacked_panel_collection.h" | 18 #include "chrome/browser/ui/panels/stacked_panel_collection.h" |
| 19 #include "chrome/common/channel_info.h" |
19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/common/chrome_version_info.h" | 21 #include "components/version_info/version_info.h" |
21 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
22 #include "content/public/browser/notification_source.h" | 23 #include "content/public/browser/notification_source.h" |
23 #include "ui/base/hit_test.h" | 24 #include "ui/base/hit_test.h" |
24 | 25 |
25 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 26 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
26 #include "base/environment.h" | 27 #include "base/environment.h" |
27 #include "base/nix/xdg_util.h" | 28 #include "base/nix/xdg_util.h" |
28 #include "ui/base/x/x11_util.h" | 29 #include "ui/base/x/x11_util.h" |
29 #endif | 30 #endif |
30 | 31 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 wm_type != ui::WM_ICE_WM && | 116 wm_type != ui::WM_ICE_WM && |
116 wm_type != ui::WM_KWIN && | 117 wm_type != ui::WM_KWIN && |
117 wm_type != ui::WM_METACITY && | 118 wm_type != ui::WM_METACITY && |
118 wm_type != ui::WM_MUFFIN && | 119 wm_type != ui::WM_MUFFIN && |
119 wm_type != ui::WM_MUTTER && | 120 wm_type != ui::WM_MUTTER && |
120 wm_type != ui::WM_XFWM4) { | 121 wm_type != ui::WM_XFWM4) { |
121 return false; | 122 return false; |
122 } | 123 } |
123 #endif // USE_X11 && !OS_CHROMEOS | 124 #endif // USE_X11 && !OS_CHROMEOS |
124 | 125 |
125 version_info::Channel channel = chrome::VersionInfo::GetChannel(); | 126 version_info::Channel channel = chrome::GetChannel(); |
126 if (channel == version_info::Channel::STABLE || | 127 if (channel == version_info::Channel::STABLE || |
127 channel == version_info::Channel::BETA) { | 128 channel == version_info::Channel::BETA) { |
128 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 129 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
129 switches::kEnablePanels) || | 130 switches::kEnablePanels) || |
130 extension_id == std::string("nckgahadagoaajjgafhacjanaoiihapd") || | 131 extension_id == std::string("nckgahadagoaajjgafhacjanaoiihapd") || |
131 extension_id == std::string("ljclpkphhpbpinifbeabbhlfddcpfdde") || | 132 extension_id == std::string("ljclpkphhpbpinifbeabbhlfddcpfdde") || |
132 extension_id == std::string("ppleadejekpmccmnpjdimmlfljlkdfej") || | 133 extension_id == std::string("ppleadejekpmccmnpjdimmlfljlkdfej") || |
133 extension_id == std::string("eggnbpckecmjlblplehfpjjdhhidfdoj"); | 134 extension_id == std::string("eggnbpckecmjlblplehfpjjdhhidfdoj"); |
134 } | 135 } |
135 | 136 |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { | 564 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { |
564 panel_mouse_watcher_.reset(watcher); | 565 panel_mouse_watcher_.reset(watcher); |
565 } | 566 } |
566 | 567 |
567 void PanelManager::OnPanelAnimationEnded(Panel* panel) { | 568 void PanelManager::OnPanelAnimationEnded(Panel* panel) { |
568 content::NotificationService::current()->Notify( | 569 content::NotificationService::current()->Notify( |
569 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 570 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
570 content::Source<Panel>(panel), | 571 content::Source<Panel>(panel), |
571 content::NotificationService::NoDetails()); | 572 content::NotificationService::NoDetails()); |
572 } | 573 } |
OLD | NEW |