| 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/launcher/launcher.h" | 5 #include "ash/launcher/launcher.h" |
| 6 | 6 |
| 7 #include <algorithm> |
| 8 |
| 7 #include "ash/focus_cycler.h" | 9 #include "ash/focus_cycler.h" |
| 8 #include "ash/launcher/launcher_delegate.h" | 10 #include "ash/launcher/launcher_delegate.h" |
| 9 #include "ash/launcher/launcher_model.h" | 11 #include "ash/launcher/launcher_model.h" |
| 10 #include "ash/launcher/launcher_navigator.h" | 12 #include "ash/launcher/launcher_navigator.h" |
| 11 #include "ash/launcher/launcher_view.h" | 13 #include "ash/launcher/launcher_view.h" |
| 12 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 13 #include "ash/shell_delegate.h" | 15 #include "ash/shell_delegate.h" |
| 14 #include "ash/shell_window_ids.h" | 16 #include "ash/shell_window_ids.h" |
| 15 #include "ash/wm/shelf_layout_manager.h" | 17 #include "ash/wm/shelf_layout_manager.h" |
| 16 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
| 17 #include "ui/compositor/layer.h" | 19 #include "ui/compositor/layer.h" |
| 18 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
| 19 #include "ui/gfx/image/image.h" | 21 #include "ui/gfx/image/image.h" |
| 20 #include "ui/views/accessible_pane_view.h" | 22 #include "ui/views/accessible_pane_view.h" |
| 21 #include "ui/views/widget/widget.h" | 23 #include "ui/views/widget/widget.h" |
| 22 #include "ui/views/widget/widget_delegate.h" | 24 #include "ui/views/widget/widget_delegate.h" |
| 23 | 25 |
| 24 namespace ash { | 26 namespace ash { |
| 25 | 27 |
| 26 namespace { | 28 namespace { |
| 27 | 29 |
| 28 // Max alpha of the background. | 30 // Max alpha of the background. |
| 29 const int kBackgroundAlpha = 128; | 31 const int kBackgroundAlpha = 128; |
| 30 | 32 |
| 31 } | 33 } |
| 32 | 34 |
| 33 // The contents view of the Widget. This view contains LauncherView and | 35 // The contents view of the Widget. This view contains LauncherView and |
| 34 // sizes it to the width of the widget minus the size of the status area. | 36 // sizes it to the width of the widget minus the size of the status area. |
| 35 class Launcher::DelegateView : public views::WidgetDelegate, | 37 class Launcher::DelegateView : public views::WidgetDelegate, |
| 36 public views::AccessiblePaneView{ | 38 public views::AccessiblePaneView { |
| 37 public: | 39 public: |
| 38 explicit DelegateView(Launcher* launcher); | 40 explicit DelegateView(Launcher* launcher); |
| 39 virtual ~DelegateView(); | 41 virtual ~DelegateView(); |
| 40 | 42 |
| 41 void set_focus_cycler(internal::FocusCycler* focus_cycler) { | 43 void set_focus_cycler(internal::FocusCycler* focus_cycler) { |
| 42 focus_cycler_ = focus_cycler; | 44 focus_cycler_ = focus_cycler; |
| 43 } | 45 } |
| 44 internal::FocusCycler* focus_cycler() { | 46 internal::FocusCycler* focus_cycler() { |
| 45 return focus_cycler_; | 47 return focus_cycler_; |
| 46 } | 48 } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 206 } |
| 205 | 207 |
| 206 void Launcher::RemoveIconObserver(LauncherIconObserver* observer) { | 208 void Launcher::RemoveIconObserver(LauncherIconObserver* observer) { |
| 207 launcher_view_->RemoveIconObserver(observer); | 209 launcher_view_->RemoveIconObserver(observer); |
| 208 } | 210 } |
| 209 | 211 |
| 210 bool Launcher::IsShowingMenu() const { | 212 bool Launcher::IsShowingMenu() const { |
| 211 return launcher_view_->IsShowingMenu(); | 213 return launcher_view_->IsShowingMenu(); |
| 212 } | 214 } |
| 213 | 215 |
| 216 bool Launcher::IsShowingOverflowBubble() const { |
| 217 return launcher_view_->IsShowingOverflowBubble(); |
| 218 } |
| 219 |
| 214 views::View* Launcher::GetAppListButtonView() const { | 220 views::View* Launcher::GetAppListButtonView() const { |
| 215 return launcher_view_->GetAppListButtonView(); | 221 return launcher_view_->GetAppListButtonView(); |
| 216 } | 222 } |
| 217 | 223 |
| 218 internal::LauncherView* Launcher::GetLauncherViewForTest() { | 224 internal::LauncherView* Launcher::GetLauncherViewForTest() { |
| 219 return launcher_view_; | 225 return launcher_view_; |
| 220 } | 226 } |
| 221 | 227 |
| 222 void Launcher::UpdateBackground(int alpha) { | 228 void Launcher::UpdateBackground(int alpha) { |
| 223 ui::Layer* layer = widget_->GetNativeView()->layer(); | 229 ui::Layer* layer = widget_->GetNativeView()->layer(); |
| 224 layer->SetColor(SkColorSetARGB(alpha, 0, 0, 0)); | 230 layer->SetColor(SkColorSetARGB(alpha, 0, 0, 0)); |
| 225 } | 231 } |
| 226 | 232 |
| 227 } // namespace ash | 233 } // namespace ash |
| OLD | NEW |