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

Unified Diff: ash/mus/root_window_controller.cc

Issue 2230723003: mash: Show status area widget, attempt 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: placeholder widget Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ash/mus/root_window_controller.cc
diff --git a/ash/mus/root_window_controller.cc b/ash/mus/root_window_controller.cc
index a7866c24ae57c25f9028364709a1bb27c9699e29..5c98ff7bc9bcbdc069d964510d551afed987ef0b 100644
--- a/ash/mus/root_window_controller.cc
+++ b/ash/mus/root_window_controller.cc
@@ -14,7 +14,9 @@
#include <vector>
#include "ash/common/root_window_controller_common.h"
+#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shell_window_ids.h"
+#include "ash/common/system/status_area_widget.h"
#include "ash/common/wm/always_on_top_controller.h"
#include "ash/common/wm/container_finder.h"
#include "ash/common/wm/dock/docked_window_layout_manager.h"
@@ -31,7 +33,6 @@
#include "ash/mus/property_util.h"
#include "ash/mus/screenlock_layout.h"
#include "ash/mus/shelf_layout_manager.h"
-#include "ash/mus/status_layout_manager.h"
#include "ash/mus/window_manager.h"
#include "base/bind.h"
#include "base/command_line.h"
@@ -92,6 +93,7 @@ RootWindowController::RootWindowController(WindowManager* window_manager,
root_window_controller_common_->CreateContainers();
root_window_controller_common_->CreateLayoutManagers();
CreateLayoutManagers();
+ CreateStatusArea();
disconnected_app_handler_.reset(new DisconnectedAppHandler(root));
@@ -219,12 +221,7 @@ void RootWindowController::CreateLayoutManagers() {
new ShelfLayoutManager(shelf_container->mus_window(), this);
layout_managers_[shelf_container->mus_window()].reset(shelf_layout_manager);
- wm_shelf_.reset(new WmShelfMus(shelf_layout_manager));
-
- WmWindowMus* status_container =
- GetWindowByShellWindowId(kShellWindowId_StatusContainer);
- layout_managers_[status_container->mus_window()].reset(
- new StatusLayoutManager(status_container->mus_window()));
+ wm_shelf_.reset(new WmShelfMus(wm_root_window_controller_.get()));
WmWindowMus* default_container =
GetWindowByShellWindowId(kShellWindowId_DefaultContainer);
@@ -249,5 +246,19 @@ void RootWindowController::CreateLayoutManagers() {
base::WrapUnique(new PanelLayoutManager(panel_container)));
}
+void RootWindowController::CreateStatusArea() {
+ WmWindowMus* status_container =
+ GetWindowByShellWindowId(kShellWindowId_StatusContainer);
+ // Owned by native widget.
+ StatusAreaWidget* status_area_widget =
+ new StatusAreaWidget(status_container, wm_shelf_.get());
+ status_area_widget->CreateTrayViews();
+ // TODO(jamescook): Remove this when ash::StatusAreaLayoutManager and
+ // ash::ShelfLayoutManager are working in mash. http://crbug.com/621112
+ status_area_widget->SetBounds(gfx::Rect(845, 720, 120, 40));
+ if (WmShell::Get()->GetSessionStateDelegate()->IsActiveUserSessionStarted())
+ status_area_widget->Show();
+}
+
} // namespace mus
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698