OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/aura_shell/launcher/launcher_view.h" |
| 6 |
| 7 #include "ui/aura/desktop.h" |
| 8 #include "ui/aura_shell/launcher/launcher_button.h" |
| 9 #include "ui/gfx/canvas.h" |
| 10 #include "views/widget/widget.h" |
| 11 |
| 12 namespace aura_shell { |
| 13 namespace internal { |
| 14 |
| 15 LauncherView::LauncherView() |
| 16 : ALLOW_THIS_IN_INITIALIZER_LIST(chrome_button_(new LauncherButton(this))), |
| 17 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 18 applist_button_(new LauncherButton(this))) { |
| 19 AddChildView(chrome_button_); |
| 20 AddChildView(applist_button_); |
| 21 } |
| 22 LauncherView::~LauncherView() { |
| 23 } |
| 24 |
| 25 void LauncherView::Layout() { |
| 26 } |
| 27 |
| 28 void LauncherView::OnPaint(gfx::Canvas* canvas) { |
| 29 canvas->FillRectInt(SK_ColorRED, 0, 0, width(), height()); |
| 30 } |
| 31 |
| 32 void LauncherView::ButtonPressed(views::Button* sender, |
| 33 const views::Event& event) { |
| 34 } |
| 35 |
| 36 views::Widget* CreateLauncher() { |
| 37 views::Widget* launcher_widget = new views::Widget; |
| 38 views::Widget::InitParams params2(views::Widget::InitParams::TYPE_CONTROL); |
| 39 params2.bounds = gfx::Rect(0, 0, 300, 64); |
| 40 params2.parent = aura::Desktop::GetInstance()->window(); |
| 41 LauncherView* launcher_view = new LauncherView; |
| 42 params2.delegate = launcher_view; |
| 43 launcher_widget->Init(params2); |
| 44 launcher_widget->SetContentsView(launcher_view); |
| 45 launcher_widget->Show(); |
| 46 return launcher_widget; |
| 47 } |
| 48 |
| 49 } // namespace internal |
| 50 } // namespace aura_shell |
OLD | NEW |