| 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/docked_panel_strip.h" | 5 #include "chrome/browser/ui/panels/docked_panel_strip.h" |
| 6 | 6 |
| 7 #include <math.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 10 #include "base/auto_reset.h" | 12 #include "base/auto_reset.h" |
| 11 #include "base/bind.h" | 13 #include "base/bind.h" |
| 12 #include "base/logging.h" | 14 #include "base/logging.h" |
| 13 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 14 #include "chrome/browser/ui/browser.h" | |
| 15 #include "chrome/browser/ui/panels/panel_manager.h" | 16 #include "chrome/browser/ui/panels/panel_manager.h" |
| 16 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" | 17 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
| 17 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
| 18 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
| 19 #include "content/public/browser/notification_source.h" | 20 #include "content/public/browser/notification_source.h" |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 // Occasionally some system, like Windows, might not bring up or down the bottom | 23 // Occasionally some system, like Windows, might not bring up or down the bottom |
| 23 // bar when the mouse enters or leaves the bottom screen area. This is the | 24 // bar when the mouse enters or leaves the bottom screen area. This is the |
| 24 // maximum time we will wait for the bottom bar visibility change notification. | 25 // maximum time we will wait for the bottom bar visibility change notification. |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 void DockedPanelStrip::OnPanelActiveStateChanged(Panel* panel) { | 861 void DockedPanelStrip::OnPanelActiveStateChanged(Panel* panel) { |
| 861 // Refresh layout, but wait till active states settle. | 862 // Refresh layout, but wait till active states settle. |
| 862 // This lets us avoid refreshing too many times when one panel loses | 863 // This lets us avoid refreshing too many times when one panel loses |
| 863 // focus and another gains it. | 864 // focus and another gains it. |
| 864 ScheduleLayoutRefresh(); | 865 ScheduleLayoutRefresh(); |
| 865 } | 866 } |
| 866 | 867 |
| 867 bool DockedPanelStrip::HasPanel(Panel* panel) const { | 868 bool DockedPanelStrip::HasPanel(Panel* panel) const { |
| 868 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); | 869 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); |
| 869 } | 870 } |
| OLD | NEW |