| 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 "ash/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <cstring> | 9 #include <cstring> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 ui::Layer* GetLayer(views::Widget* widget) { | 63 ui::Layer* GetLayer(views::Widget* widget) { |
| 64 return widget->GetNativeView()->layer(); | 64 return widget->GetNativeView()->layer(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool IsDraggingTrayEnabled() { | 67 bool IsDraggingTrayEnabled() { |
| 68 static bool dragging_tray_allowed = CommandLine::ForCurrentProcess()-> | 68 static bool dragging_tray_allowed = CommandLine::ForCurrentProcess()-> |
| 69 HasSwitch(ash::switches::kAshEnableTrayDragging); | 69 HasSwitch(ash::switches::kAshEnableTrayDragging); |
| 70 return dragging_tray_allowed; | 70 return dragging_tray_allowed; |
| 71 } | 71 } |
| 72 | 72 |
| 73 int GetPreferredShelfSize() { | |
| 74 return ash::switches::UseAlternateShelfLayout() ? | |
| 75 ShelfLayoutManager::kShelfSize : kLauncherPreferredSize; | |
| 76 } | |
| 77 | |
| 78 } // namespace | 73 } // namespace |
| 79 | 74 |
| 80 // static | 75 // static |
| 81 const int ShelfLayoutManager::kWorkspaceAreaVisibleInset = 2; | 76 const int ShelfLayoutManager::kWorkspaceAreaVisibleInset = 2; |
| 82 | 77 |
| 83 // static | 78 // static |
| 84 const int ShelfLayoutManager::kWorkspaceAreaAutoHideInset = 5; | 79 const int ShelfLayoutManager::kWorkspaceAreaAutoHideInset = 5; |
| 85 | 80 |
| 86 // static | 81 // static |
| 87 const int ShelfLayoutManager::kAutoHideSize = 3; | 82 const int ShelfLayoutManager::kAutoHideSize = 3; |
| 88 | 83 |
| 89 // static | 84 // static |
| 90 const int ShelfLayoutManager::kShelfSize = 47; | 85 const int ShelfLayoutManager::kShelfSize = 47; |
| 91 | 86 |
| 87 int ShelfLayoutManager::GetPreferredShelfSize() { |
| 88 return ash::switches::UseAlternateShelfLayout() ? |
| 89 ShelfLayoutManager::kShelfSize : kLauncherPreferredSize; |
| 90 } |
| 91 |
| 92 // ShelfLayoutManager::AutoHideEventFilter ------------------------------------- | 92 // ShelfLayoutManager::AutoHideEventFilter ------------------------------------- |
| 93 | 93 |
| 94 // Notifies ShelfLayoutManager any time the mouse moves. | 94 // Notifies ShelfLayoutManager any time the mouse moves. |
| 95 class ShelfLayoutManager::AutoHideEventFilter : public ui::EventHandler { | 95 class ShelfLayoutManager::AutoHideEventFilter : public ui::EventHandler { |
| 96 public: | 96 public: |
| 97 explicit AutoHideEventFilter(ShelfLayoutManager* shelf); | 97 explicit AutoHideEventFilter(ShelfLayoutManager* shelf); |
| 98 virtual ~AutoHideEventFilter(); | 98 virtual ~AutoHideEventFilter(); |
| 99 | 99 |
| 100 // Returns true if the last mouse event was a mouse drag. | 100 // Returns true if the last mouse event was a mouse drag. |
| 101 bool in_mouse_drag() const { return in_mouse_drag_; } | 101 bool in_mouse_drag() const { return in_mouse_drag_; } |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 return gfx::Insets(0, distance, 0, 0); | 1000 return gfx::Insets(0, distance, 0, 0); |
| 1001 case SHELF_ALIGNMENT_TOP: | 1001 case SHELF_ALIGNMENT_TOP: |
| 1002 return gfx::Insets(0, 0, distance, 0); | 1002 return gfx::Insets(0, 0, distance, 0); |
| 1003 } | 1003 } |
| 1004 NOTREACHED(); | 1004 NOTREACHED(); |
| 1005 return gfx::Insets(); | 1005 return gfx::Insets(); |
| 1006 } | 1006 } |
| 1007 | 1007 |
| 1008 } // namespace internal | 1008 } // namespace internal |
| 1009 } // namespace ash | 1009 } // namespace ash |
| OLD | NEW |