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

Side by Side Diff: ui/aura_shell/examples/lock_view.cc

Issue 8399044: aura: Make sure the desktop widget gets parented to the correct container. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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_background_view.cc ('k') | ui/aura_shell/workspace/workspace_manager.cc » ('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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "ui/aura/desktop.h" 6 #include "ui/aura/desktop.h"
7 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
8 #include "ui/aura_shell/examples/example_factory.h" 8 #include "ui/aura_shell/examples/example_factory.h"
9 #include "ui/aura_shell/shell.h" 9 #include "ui/aura_shell/shell.h"
10 #include "ui/aura_shell/shell_window_ids.h" 10 #include "ui/aura_shell/shell_window_ids.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 LockView* lock_view = new LockView; 53 LockView* lock_view = new LockView;
54 views::Widget* widget = new views::Widget; 54 views::Widget* widget = new views::Widget;
55 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); 55 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
56 gfx::Size ps = lock_view->GetPreferredSize(); 56 gfx::Size ps = lock_view->GetPreferredSize();
57 57
58 gfx::Size desktop_size = aura::Desktop::GetInstance()->GetHostSize(); 58 gfx::Size desktop_size = aura::Desktop::GetInstance()->GetHostSize();
59 params.bounds = gfx::Rect((desktop_size.width() - ps.width()) / 2, 59 params.bounds = gfx::Rect((desktop_size.width() - ps.width()) / 2,
60 (desktop_size.height() - ps.height()) / 2, 60 (desktop_size.height() - ps.height()) / 2,
61 ps.width(), ps.height()); 61 ps.width(), ps.height());
62 params.delegate = lock_view; 62 params.delegate = lock_view;
63 params.parent = Shell::GetInstance()->GetContainer(
64 aura_shell::internal::kShellWindowId_LockScreenContainer);
65 widget->Init(params); 63 widget->Init(params);
64 Shell::GetInstance()->GetContainer(
65 aura_shell::internal::kShellWindowId_LockScreenContainer)->
66 AddChild(widget->GetNativeView());
66 widget->SetContentsView(lock_view); 67 widget->SetContentsView(lock_view);
67 widget->Show(); 68 widget->Show();
68 widget->GetNativeView()->set_name("LockView"); 69 widget->GetNativeView()->set_name("LockView");
69 } 70 }
70 71
71 } // namespace examples 72 } // namespace examples
72 } // namespace aura_shell 73 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/desktop_background_view.cc ('k') | ui/aura_shell/workspace/workspace_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698