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

Unified Diff: ui/aura_shell/shell.cc

Issue 8509027: Add status area to Aura builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move status area view ids back to chromeos 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/shell_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/shell.cc
diff --git a/ui/aura_shell/shell.cc b/ui/aura_shell/shell.cc
index a9d9c817ab547af063e9e20ffffc253026a4f13f..c16b63cd4313cb1206a4b0ff5d710de427a78229 100644
--- a/ui/aura_shell/shell.cc
+++ b/ui/aura_shell/shell.cc
@@ -82,8 +82,9 @@ Shell* Shell::instance_ = NULL;
////////////////////////////////////////////////////////////////////////////////
// Shell, public:
-Shell::Shell()
- : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
+Shell::Shell(ShellDelegate* delegate)
+ : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
+ delegate_(delegate) {
aura::Desktop::GetInstance()->SetEventFilter(
new internal::DesktopEventFilter);
aura::Desktop::GetInstance()->SetStackingClient(
@@ -97,11 +98,16 @@ Shell::~Shell() {
}
// static
+Shell* Shell::CreateInstance(ShellDelegate* delegate) {
+ CHECK(!instance_);
+ instance_ = new Shell(delegate);
+ instance_->Init();
+ return instance_;
+}
+
+// static
Shell* Shell::GetInstance() {
- if (!instance_) {
- instance_ = new Shell;
- instance_->Init();
- }
+ DCHECK(instance_);
return instance_;
}
@@ -133,8 +139,15 @@ void Shell::Init() {
GetContainer(internal::kShellWindowId_DefaultContainer);
launcher_.reset(new Launcher(default_container));
+ views::Widget* status_widget = NULL;
+ if (delegate_.get())
+ status_widget = delegate_->CreateStatusArea();
+ if (!status_widget)
+ status_widget = internal::CreateStatusArea();
+
shelf_layout_controller_.reset(new internal::ShelfLayoutController(
- launcher_->widget(), internal::CreateStatusArea()));
+ launcher_->widget(), status_widget));
+
desktop_layout->set_shelf(shelf_layout_controller_.get());
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraWindows)) {
@@ -150,10 +163,6 @@ void Shell::Init() {
desktop_layout->OnWindowResized();
}
-void Shell::SetDelegate(ShellDelegate* delegate) {
- delegate_.reset(delegate);
-}
-
aura::Window* Shell::GetContainer(int container_id) {
return const_cast<aura::Window*>(
const_cast<const aura_shell::Shell*>(this)->GetContainer(container_id));
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698