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

Side by Side Diff: ash/system/tray/system_tray_bubble.cc

Issue 2058173002: mash: Move SystemTrayDelegate ownership to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback Created 4 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/system/tray/system_tray_bubble.h" 5 #include "ash/system/tray/system_tray_bubble.h"
6 6
7 #include "ash/common/system/tray/system_tray_delegate.h" 7 #include "ash/common/system/tray/system_tray_delegate.h"
8 #include "ash/common/system/tray/tray_constants.h" 8 #include "ash/common/system/tray/tray_constants.h"
9 #include "ash/common/wm_shell.h"
9 #include "ash/shell.h" 10 #include "ash/shell.h"
10 #include "ash/system/tray/system_tray.h" 11 #include "ash/system/tray/system_tray.h"
11 #include "ash/system/tray/system_tray_item.h" 12 #include "ash/system/tray/system_tray_item.h"
12 #include "ash/system/tray/tray_bubble_wrapper.h" 13 #include "ash/system/tray/tray_bubble_wrapper.h"
13 #include "ash/system/tray/tray_popup_item_container.h" 14 #include "ash/system/tray/tray_popup_item_container.h"
14 #include "base/threading/thread_task_runner_handle.h" 15 #include "base/threading/thread_task_runner_handle.h"
15 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
16 #include "ui/compositor/layer.h" 17 #include "ui/compositor/layer.h"
17 #include "ui/compositor/layer_animation_observer.h" 18 #include "ui/compositor/layer_animation_observer.h"
18 #include "ui/compositor/scoped_layer_animation_settings.h" 19 #include "ui/compositor/scoped_layer_animation_settings.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 shadow->SetOpacity(0.15f); 132 shadow->SetOpacity(0.15f);
132 } 133 }
133 } 134 }
134 } 135 }
135 136
136 DestroyItemViews(); 137 DestroyItemViews();
137 bubble_view_->RemoveAllChildViews(true); 138 bubble_view_->RemoveAllChildViews(true);
138 139
139 items_ = items; 140 items_ = items;
140 bubble_type_ = bubble_type; 141 bubble_type_ = bubble_type;
141 CreateItemViews( 142 CreateItemViews(WmShell::Get()->system_tray_delegate()->GetUserLoginStatus());
142 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus());
143 143
144 // Close bubble view if we failed to create the item view. 144 // Close bubble view if we failed to create the item view.
145 if (!bubble_view_->has_children()) { 145 if (!bubble_view_->has_children()) {
146 Close(); 146 Close();
147 return; 147 return;
148 } 148 }
149 149
150 bubble_view_->GetWidget()->GetContentsView()->Layout(); 150 bubble_view_->GetWidget()->GetContentsView()->Layout();
151 // Make sure that the bubble is large enough for the default view. 151 // Make sure that the bubble is large enough for the default view.
152 if (bubble_type_ == BUBBLE_TYPE_DEFAULT) { 152 if (bubble_type_ == BUBBLE_TYPE_DEFAULT) {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // 2 items, which are the bottom header row and the one just above it. 316 // 2 items, which are the bottom header row and the one just above it.
317 bubble_view_->AddChildView(new TrayPopupItemContainer( 317 bubble_view_->AddChildView(new TrayPopupItemContainer(
318 item_views[i], is_default_bubble, 318 item_views[i], is_default_bubble,
319 is_default_bubble && (i < item_views.size() - 2))); 319 is_default_bubble && (i < item_views.size() - 2)));
320 } 320 }
321 if (focus_view) 321 if (focus_view)
322 focus_view->RequestFocus(); 322 focus_view->RequestFocus();
323 } 323 }
324 324
325 } // namespace ash 325 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698