Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: ui/aura_shell/launcher/launcher_view.cc

Issue 8194004: change the way windows are parented when their parent is set to NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura_shell/desktop_window.cc ('k') | ui/aura_shell/shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "ui/aura_shell/launcher/launcher_view.h" 5 #include "ui/aura_shell/launcher/launcher_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/aura/desktop.h" 8 #include "ui/aura/desktop.h"
9 #include "ui/aura_shell/aura_shell_export.h" 9 #include "ui/aura_shell/aura_shell_export.h"
10 #include "ui/aura_shell/launcher/launcher_button.h" 10 #include "ui/aura_shell/launcher/launcher_button.h"
11 #include "ui/aura_shell/shell_window_ids.h"
11 #include "ui/gfx/canvas.h" 12 #include "ui/gfx/canvas.h"
12 #include "ui/gfx/compositor/layer.h" 13 #include "ui/gfx/compositor/layer.h"
13 #include "views/widget/widget.h" 14 #include "views/widget/widget.h"
14 15
15 namespace aura_shell { 16 namespace aura_shell {
16 namespace internal { 17 namespace internal {
17 18
18 LauncherView::LauncherView() 19 LauncherView::LauncherView()
19 : ALLOW_THIS_IN_INITIALIZER_LIST(chrome_button_(new LauncherButton(this))), 20 : ALLOW_THIS_IN_INITIALIZER_LIST(chrome_button_(new LauncherButton(this))),
20 ALLOW_THIS_IN_INITIALIZER_LIST( 21 ALLOW_THIS_IN_INITIALIZER_LIST(
21 applist_button_(new LauncherButton(this))) { 22 applist_button_(new LauncherButton(this))) {
22 AddChildView(chrome_button_); 23 AddChildView(chrome_button_);
23 AddChildView(applist_button_); 24 AddChildView(applist_button_);
24 } 25 }
25 LauncherView::~LauncherView() { 26 LauncherView::~LauncherView() {
26 } 27 }
27 28
28 void LauncherView::Layout() { 29 void LauncherView::Layout() {
29 } 30 }
30 31
31 void LauncherView::OnPaint(gfx::Canvas* canvas) { 32 void LauncherView::OnPaint(gfx::Canvas* canvas) {
32 canvas->FillRectInt(SK_ColorRED, 0, 0, width(), height()); 33 canvas->FillRectInt(SK_ColorRED, 0, 0, width(), height());
33 } 34 }
34 35
35 void LauncherView::ButtonPressed(views::Button* sender, 36 void LauncherView::ButtonPressed(views::Button* sender,
36 const views::Event& event) { 37 const views::Event& event) {
37 } 38 }
38 39
39 AURA_SHELL_EXPORT views::Widget* CreateLauncher() { 40 views::Widget* CreateLauncher() {
40 views::Widget* launcher_widget = new views::Widget; 41 views::Widget* launcher_widget = new views::Widget;
41 views::Widget::InitParams params2(views::Widget::InitParams::TYPE_CONTROL); 42 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
42 params2.bounds = gfx::Rect(0, 0, 300, 64); 43 params.bounds = gfx::Rect(0, 0, 300, 64);
44 params.parent = aura::Desktop::GetInstance()->window()->GetChildById(
45 aura_shell::internal::kShellWindowId_LauncherContainer);
43 LauncherView* launcher_view = new LauncherView; 46 LauncherView* launcher_view = new LauncherView;
44 params2.delegate = launcher_view; 47 params.delegate = launcher_view;
45 launcher_widget->Init(params2); 48 launcher_widget->Init(params);
46 launcher_widget->GetNativeWindow()->layer()->SetOpacity(0.2f); 49 launcher_widget->GetNativeWindow()->layer()->SetOpacity(0.2f);
47 launcher_widget->SetContentsView(launcher_view); 50 launcher_widget->SetContentsView(launcher_view);
48 launcher_widget->Show(); 51 launcher_widget->Show();
49 launcher_widget->GetNativeView()->set_name("LauncherView"); 52 launcher_widget->GetNativeView()->set_name("LauncherView");
50 return launcher_widget; 53 return launcher_widget;
51 } 54 }
52 55
53 } // namespace internal 56 } // namespace internal
54 } // namespace aura_shell 57 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/desktop_window.cc ('k') | ui/aura_shell/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698