OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/sysui/shelf_delegate_mus.h" | 5 #include "ash/sysui/shelf_delegate_mus.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "ash/common/shelf/shelf_item_delegate.h" | 9 #include "ash/common/shelf/shelf_item_delegate.h" |
10 #include "ash/common/shelf/shelf_menu_model.h" | 10 #include "ash/common/shelf/shelf_menu_model.h" |
11 #include "ash/common/shelf/shelf_model.h" | 11 #include "ash/common/shelf/shelf_model.h" |
12 #include "ash/common/shelf/shelf_types.h" | 12 #include "ash/common/shelf/shelf_types.h" |
13 #include "ash/common/system/status_area_widget.h" | 13 #include "ash/common/system/status_area_widget.h" |
14 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
15 #include "ash/shelf/shelf.h" | 15 #include "ash/shelf/shelf.h" |
16 #include "ash/shelf/shelf_layout_manager.h" | 16 #include "ash/shelf/shelf_layout_manager.h" |
17 #include "ash/shelf/shelf_widget.h" | 17 #include "ash/shelf/shelf_widget.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "mojo/common/common_type_converters.h" | 19 #include "mojo/common/common_type_converters.h" |
20 #include "services/shell/public/cpp/connector.h" | 20 #include "services/shell/public/cpp/connector.h" |
21 #include "services/ui/public/cpp/property_type_converters.h" | 21 #include "services/ui/public/cpp/property_type_converters.h" |
22 #include "services/ui/public/cpp/window.h" | 22 #include "services/ui/public/cpp/window.h" |
23 #include "services/ui/public/cpp/window_property.h" | 23 #include "services/ui/public/cpp/window_property.h" |
24 #include "ui/aura/mus/mus_util.h" | 24 #include "ui/aura/mus/mus_util.h" |
25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
26 #include "ui/gfx/image/image_skia.h" | 26 #include "ui/gfx/image/image_skia.h" |
27 #include "ui/resources/grit/ui_resources.h" | 27 #include "ui/resources/grit/ui_resources.h" |
28 #include "ui/views/mus/window_manager_connection.h" | 28 #include "ui/views/mus/window_manager_connection.h" |
29 | 29 |
30 using ash::mojom::UserWindowController; | |
31 | |
32 namespace ash { | 30 namespace ash { |
33 namespace sysui { | 31 namespace sysui { |
34 | 32 |
35 namespace { | 33 namespace { |
36 | 34 |
37 // A ShelfItemDelegate used for pinned items and open user windows. | 35 // A ShelfItemDelegate used for pinned items. |
| 36 // TODO(mash): Support open user windows, etc. |
38 class ShelfItemDelegateMus : public ShelfItemDelegate { | 37 class ShelfItemDelegateMus : public ShelfItemDelegate { |
39 public: | 38 public: |
40 explicit ShelfItemDelegateMus(UserWindowController* user_window_controller) | 39 ShelfItemDelegateMus() {} |
41 : user_window_controller_(user_window_controller) {} | |
42 ~ShelfItemDelegateMus() override {} | 40 ~ShelfItemDelegateMus() override {} |
43 | 41 |
44 void SetDelegate( | 42 void SetDelegate( |
45 mash::shelf::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) { | 43 mash::shelf::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) { |
46 delegate_.Bind(std::move(delegate)); | 44 delegate_.Bind(std::move(delegate)); |
47 } | 45 } |
48 | 46 |
49 bool pinned() const { return pinned_; } | 47 bool pinned() const { return pinned_; } |
50 void set_pinned(bool pinned) { pinned_ = pinned; } | 48 void set_pinned(bool pinned) { pinned_ = pinned; } |
51 | 49 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 81 |
84 // ShelfMenuModel: | 82 // ShelfMenuModel: |
85 bool IsCommandActive(int command_id) const override { return false; } | 83 bool IsCommandActive(int command_id) const override { return false; } |
86 | 84 |
87 // ui::SimpleMenuModel::Delegate: | 85 // ui::SimpleMenuModel::Delegate: |
88 bool IsCommandIdChecked(int command_id) const override { return false; } | 86 bool IsCommandIdChecked(int command_id) const override { return false; } |
89 bool IsCommandIdEnabled(int command_id) const override { | 87 bool IsCommandIdEnabled(int command_id) const override { |
90 return command_id > 0; | 88 return command_id > 0; |
91 } | 89 } |
92 void ExecuteCommand(int command_id, int event_flags) override { | 90 void ExecuteCommand(int command_id, int event_flags) override { |
93 item_delegate_->user_window_controller_->ActivateUserWindow(command_id); | 91 NOTIMPLEMENTED(); |
94 } | 92 } |
95 | 93 |
96 private: | 94 private: |
97 ShelfItemDelegateMus* item_delegate_; | 95 ShelfItemDelegateMus* item_delegate_; |
98 | 96 |
99 DISALLOW_COPY_AND_ASSIGN(ShelfMenuModelMus); | 97 DISALLOW_COPY_AND_ASSIGN(ShelfMenuModelMus); |
100 }; | 98 }; |
101 | 99 |
102 // ShelfItemDelegate: | 100 // ShelfItemDelegate: |
103 ShelfItemDelegate::PerformedAction ItemSelected( | 101 ShelfItemDelegate::PerformedAction ItemSelected( |
104 const ui::Event& event) override { | 102 const ui::Event& event) override { |
105 if (window_id_to_title_.empty()) { | 103 if (window_id_to_title_.empty()) { |
106 delegate_->LaunchItem(); | 104 delegate_->LaunchItem(); |
107 return kNewWindowCreated; | 105 return kNewWindowCreated; |
108 } | 106 } |
109 if (window_id_to_title_.size() == 1) { | 107 if (window_id_to_title_.size() == 1) { |
110 user_window_controller_->ActivateUserWindow( | 108 // TODO(mash): Activate the window and return kExistingWindowActivated. |
111 window_id_to_title_.begin()->first); | 109 NOTIMPLEMENTED(); |
112 return kExistingWindowActivated; | |
113 } | 110 } |
114 return kNoAction; | 111 return kNoAction; |
115 } | 112 } |
116 | 113 |
117 base::string16 GetTitle() override { | 114 base::string16 GetTitle() override { |
118 return window_id_to_title_.empty() ? title_ | 115 return window_id_to_title_.empty() ? title_ |
119 : window_id_to_title_.begin()->second; | 116 : window_id_to_title_.begin()->second; |
120 } | 117 } |
121 | 118 |
122 bool CanPin() const override { | 119 bool CanPin() const override { |
(...skipping 11 matching lines...) Expand all Loading... |
134 } | 131 } |
135 | 132 |
136 bool ShouldShowTooltip() override { return true; } | 133 bool ShouldShowTooltip() override { return true; } |
137 | 134 |
138 void Close() override { NOTIMPLEMENTED(); } | 135 void Close() override { NOTIMPLEMENTED(); } |
139 | 136 |
140 mash::shelf::mojom::ShelfItemDelegateAssociatedPtr delegate_; | 137 mash::shelf::mojom::ShelfItemDelegateAssociatedPtr delegate_; |
141 bool pinned_ = false; | 138 bool pinned_ = false; |
142 std::map<uint32_t, base::string16> window_id_to_title_; | 139 std::map<uint32_t, base::string16> window_id_to_title_; |
143 base::string16 title_; | 140 base::string16 title_; |
144 UserWindowController* user_window_controller_; | |
145 | 141 |
146 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateMus); | 142 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateMus); |
147 }; | 143 }; |
148 | 144 |
149 ShelfItemDelegateMus* GetShelfItemDelegate(ShelfID shelf_id) { | 145 ShelfItemDelegateMus* GetShelfItemDelegate(ShelfID shelf_id) { |
150 return static_cast<ShelfItemDelegateMus*>( | 146 return static_cast<ShelfItemDelegateMus*>( |
151 WmShell::Get()->shelf_model()->GetShelfItemDelegate(shelf_id)); | 147 WmShell::Get()->shelf_model()->GetShelfItemDelegate(shelf_id)); |
152 } | 148 } |
153 | 149 |
154 // Returns an icon image from an SkBitmap, or the default shelf icon | 150 // Returns an icon image from an SkBitmap, or the default shelf icon |
(...skipping 13 matching lines...) Expand all Loading... |
168 | 164 |
169 // Returns an icon image from a serialized SkBitmap. | 165 // Returns an icon image from a serialized SkBitmap. |
170 gfx::ImageSkia GetShelfIconFromSerializedBitmap( | 166 gfx::ImageSkia GetShelfIconFromSerializedBitmap( |
171 const mojo::Array<uint8_t>& serialized_bitmap) { | 167 const mojo::Array<uint8_t>& serialized_bitmap) { |
172 SkBitmap bitmap = mojo::ConvertTo<SkBitmap>(serialized_bitmap.storage()); | 168 SkBitmap bitmap = mojo::ConvertTo<SkBitmap>(serialized_bitmap.storage()); |
173 return GetShelfIconFromBitmap(bitmap); | 169 return GetShelfIconFromBitmap(bitmap); |
174 } | 170 } |
175 | 171 |
176 } // namespace | 172 } // namespace |
177 | 173 |
178 ShelfDelegateMus::ShelfDelegateMus(ShelfModel* model) | 174 ShelfDelegateMus::ShelfDelegateMus(ShelfModel* model) : model_(model) {} |
179 : model_(model), binding_(this) { | |
180 ::shell::Connector* connector = | |
181 views::WindowManagerConnection::Get()->connector(); | |
182 connector->ConnectToInterface("mojo:ash", &shelf_layout_); | |
183 connector->ConnectToInterface("mojo:ash", &user_window_controller_); | |
184 user_window_controller_->AddUserWindowObserver( | |
185 binding_.CreateInterfacePtrAndBind()); | |
186 } | |
187 | 175 |
188 ShelfDelegateMus::~ShelfDelegateMus() {} | 176 ShelfDelegateMus::~ShelfDelegateMus() {} |
189 | 177 |
190 /////////////////////////////////////////////////////////////////////////////// | 178 /////////////////////////////////////////////////////////////////////////////// |
191 // ShelfDelegate: | 179 // ShelfDelegate: |
192 | 180 |
193 void ShelfDelegateMus::OnShelfCreated(Shelf* shelf) { | 181 void ShelfDelegateMus::OnShelfCreated(Shelf* shelf) { |
194 SetShelfPreferredSizes(shelf); | 182 SetShelfPreferredSizes(shelf); |
195 } | 183 } |
196 | 184 |
197 void ShelfDelegateMus::OnShelfDestroyed(Shelf* shelf) { | 185 void ShelfDelegateMus::OnShelfDestroyed(Shelf* shelf) { |
198 NOTIMPLEMENTED(); | 186 NOTIMPLEMENTED(); |
199 } | 187 } |
200 | 188 |
201 void ShelfDelegateMus::OnShelfAlignmentChanged(Shelf* shelf) { | 189 void ShelfDelegateMus::OnShelfAlignmentChanged(Shelf* shelf) { |
202 SetShelfPreferredSizes(shelf); | 190 SetShelfPreferredSizes(shelf); |
203 mash::shelf::mojom::Alignment alignment = | 191 mash::shelf::mojom::Alignment alignment = |
204 static_cast<mash::shelf::mojom::Alignment>(shelf->alignment()); | 192 static_cast<mash::shelf::mojom::Alignment>(shelf->alignment()); |
205 shelf_layout_->SetAlignment(alignment); | |
206 | |
207 observers_.ForAllPtrs( | 193 observers_.ForAllPtrs( |
208 [alignment](mash::shelf::mojom::ShelfObserver* observer) { | 194 [alignment](mash::shelf::mojom::ShelfObserver* observer) { |
209 observer->OnAlignmentChanged(alignment); | 195 observer->OnAlignmentChanged(alignment); |
210 }); | 196 }); |
211 } | 197 } |
212 | 198 |
213 void ShelfDelegateMus::OnShelfAutoHideBehaviorChanged(Shelf* shelf) { | 199 void ShelfDelegateMus::OnShelfAutoHideBehaviorChanged(Shelf* shelf) { |
214 mash::shelf::mojom::AutoHideBehavior behavior = | 200 mash::shelf::mojom::AutoHideBehavior behavior = |
215 static_cast<mash::shelf::mojom::AutoHideBehavior>( | 201 static_cast<mash::shelf::mojom::AutoHideBehavior>( |
216 shelf->auto_hide_behavior()); | 202 shelf->auto_hide_behavior()); |
217 shelf_layout_->SetAutoHideBehavior(behavior); | |
218 | |
219 observers_.ForAllPtrs( | 203 observers_.ForAllPtrs( |
220 [behavior](mash::shelf::mojom::ShelfObserver* observer) { | 204 [behavior](mash::shelf::mojom::ShelfObserver* observer) { |
221 observer->OnAutoHideBehaviorChanged(behavior); | 205 observer->OnAutoHideBehaviorChanged(behavior); |
222 }); | 206 }); |
223 } | 207 } |
224 | 208 |
225 void ShelfDelegateMus::OnShelfAutoHideStateChanged(Shelf* shelf) { | 209 void ShelfDelegateMus::OnShelfAutoHideStateChanged(Shelf* shelf) { |
226 // Push the new preferred size to the window manager. For example, when the | 210 // Push the new preferred size to the window manager. For example, when the |
227 // shelf is auto-hidden it becomes a very short "light bar". | 211 // shelf is auto-hidden it becomes a very short "light bar". |
228 SetShelfPreferredSizes(shelf); | 212 SetShelfPreferredSizes(shelf); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 app_id_to_shelf_id_.insert(std::make_pair(app_id, shelf_id)); | 289 app_id_to_shelf_id_.insert(std::make_pair(app_id, shelf_id)); |
306 shelf_id_to_app_id_.insert(std::make_pair(shelf_id, app_id)); | 290 shelf_id_to_app_id_.insert(std::make_pair(shelf_id, app_id)); |
307 | 291 |
308 ShelfItem shelf_item; | 292 ShelfItem shelf_item; |
309 shelf_item.type = TYPE_APP_SHORTCUT; | 293 shelf_item.type = TYPE_APP_SHORTCUT; |
310 shelf_item.status = STATUS_CLOSED; | 294 shelf_item.status = STATUS_CLOSED; |
311 shelf_item.image = GetShelfIconFromBitmap(item->image); | 295 shelf_item.image = GetShelfIconFromBitmap(item->image); |
312 model_->Add(shelf_item); | 296 model_->Add(shelf_item); |
313 | 297 |
314 std::unique_ptr<ShelfItemDelegateMus> item_delegate( | 298 std::unique_ptr<ShelfItemDelegateMus> item_delegate( |
315 new ShelfItemDelegateMus(user_window_controller_.get())); | 299 new ShelfItemDelegateMus()); |
316 item_delegate->SetDelegate(std::move(delegate)); | 300 item_delegate->SetDelegate(std::move(delegate)); |
317 item_delegate->set_pinned(true); | 301 item_delegate->set_pinned(true); |
318 item_delegate->set_title(item->app_title.To<base::string16>()); | 302 item_delegate->set_title(item->app_title.To<base::string16>()); |
319 model_->SetShelfItemDelegate(shelf_id, std::move(item_delegate)); | 303 model_->SetShelfItemDelegate(shelf_id, std::move(item_delegate)); |
320 } | 304 } |
321 | 305 |
322 void ShelfDelegateMus::UnpinItem(const mojo::String& app_id) { | 306 void ShelfDelegateMus::UnpinItem(const mojo::String& app_id) { |
323 if (!app_id_to_shelf_id_.count(app_id.To<std::string>())) | 307 if (!app_id_to_shelf_id_.count(app_id.To<std::string>())) |
324 return; | 308 return; |
325 ShelfID shelf_id = app_id_to_shelf_id_[app_id.To<std::string>()]; | 309 ShelfID shelf_id = app_id_to_shelf_id_[app_id.To<std::string>()]; |
(...skipping 12 matching lines...) Expand all Loading... |
338 if (!app_id_to_shelf_id_.count(app_id.To<std::string>())) | 322 if (!app_id_to_shelf_id_.count(app_id.To<std::string>())) |
339 return; | 323 return; |
340 ShelfID shelf_id = app_id_to_shelf_id_[app_id.To<std::string>()]; | 324 ShelfID shelf_id = app_id_to_shelf_id_[app_id.To<std::string>()]; |
341 int index = model_->ItemIndexByID(shelf_id); | 325 int index = model_->ItemIndexByID(shelf_id); |
342 DCHECK_GE(index, 0); | 326 DCHECK_GE(index, 0); |
343 ShelfItem item = *model_->ItemByID(shelf_id); | 327 ShelfItem item = *model_->ItemByID(shelf_id); |
344 item.image = GetShelfIconFromBitmap(image); | 328 item.image = GetShelfIconFromBitmap(image); |
345 model_->Set(index, item); | 329 model_->Set(index, item); |
346 } | 330 } |
347 | 331 |
348 void ShelfDelegateMus::OnUserWindowObserverAdded( | |
349 mojo::Array<ash::mojom::UserWindowPtr> user_windows) { | |
350 for (size_t i = 0; i < user_windows.size(); ++i) | |
351 OnUserWindowAdded(std::move(user_windows[i])); | |
352 } | |
353 | |
354 void ShelfDelegateMus::OnUserWindowAdded( | |
355 ash::mojom::UserWindowPtr user_window) { | |
356 DCHECK(!window_id_to_shelf_id_.count(user_window->window_id)); | |
357 | |
358 if (user_window->ignored_by_shelf) | |
359 return; | |
360 | |
361 std::string app_id(user_window->window_app_id.To<std::string>()); | |
362 if (app_id_to_shelf_id_.count(app_id)) { | |
363 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; | |
364 window_id_to_shelf_id_.insert( | |
365 std::make_pair(user_window->window_id, shelf_id)); | |
366 | |
367 ShelfItemDelegateMus* item_delegate = GetShelfItemDelegate(shelf_id); | |
368 item_delegate->AddWindow(user_window->window_id, | |
369 user_window->window_title.To<base::string16>()); | |
370 return; | |
371 } | |
372 | |
373 ShelfID shelf_id = model_->next_id(); | |
374 window_id_to_shelf_id_.insert( | |
375 std::make_pair(user_window->window_id, shelf_id)); | |
376 app_id_to_shelf_id_.insert(std::make_pair(app_id, shelf_id)); | |
377 shelf_id_to_app_id_.insert(std::make_pair(shelf_id, app_id)); | |
378 | |
379 ShelfItem item; | |
380 item.type = TYPE_PLATFORM_APP; | |
381 item.status = user_window->window_has_focus ? STATUS_ACTIVE : STATUS_RUNNING; | |
382 item.image = GetShelfIconFromSerializedBitmap(user_window->window_app_icon); | |
383 model_->Add(item); | |
384 | |
385 std::unique_ptr<ShelfItemDelegateMus> item_delegate( | |
386 new ShelfItemDelegateMus(user_window_controller_.get())); | |
387 item_delegate->AddWindow(user_window->window_id, | |
388 user_window->window_title.To<base::string16>()); | |
389 model_->SetShelfItemDelegate(shelf_id, std::move(item_delegate)); | |
390 } | |
391 | |
392 void ShelfDelegateMus::OnUserWindowRemoved(uint32_t window_id) { | |
393 if (!window_id_to_shelf_id_.count(window_id)) | |
394 return; | |
395 ShelfID shelf_id = window_id_to_shelf_id_[window_id]; | |
396 ShelfItemDelegateMus* item_delegate = GetShelfItemDelegate(shelf_id); | |
397 item_delegate->RemoveWindow(window_id); | |
398 window_id_to_shelf_id_.erase(window_id); | |
399 if (item_delegate->window_id_to_title().empty() && !item_delegate->pinned()) { | |
400 model_->RemoveItemAt(model_->ItemIndexByID(shelf_id)); | |
401 const std::string& app_id = shelf_id_to_app_id_[shelf_id]; | |
402 app_id_to_shelf_id_.erase(app_id); | |
403 shelf_id_to_app_id_.erase(shelf_id); | |
404 } | |
405 } | |
406 | |
407 void ShelfDelegateMus::OnUserWindowTitleChanged( | |
408 uint32_t window_id, | |
409 const mojo::String& window_title) { | |
410 if (!window_id_to_shelf_id_.count(window_id)) | |
411 return; | |
412 ShelfID shelf_id = window_id_to_shelf_id_[window_id]; | |
413 ShelfItemDelegateMus* item_delegate = GetShelfItemDelegate(shelf_id); | |
414 item_delegate->SetWindowTitle(window_id, window_title.To<base::string16>()); | |
415 | |
416 // There's nothing in the ShelfItem that needs to be updated. But we still | |
417 // need to update the ShelfModel so that the observers can pick up any | |
418 // changes. | |
419 int index = model_->ItemIndexByID(shelf_id); | |
420 DCHECK_GE(index, 0); | |
421 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id); | |
422 DCHECK(iter != model_->items().end()); | |
423 model_->Set(index, *iter); | |
424 } | |
425 | |
426 void ShelfDelegateMus::OnUserWindowAppIconChanged( | |
427 uint32_t window_id, | |
428 mojo::Array<uint8_t> app_icon) { | |
429 if (!window_id_to_shelf_id_.count(window_id)) | |
430 return; | |
431 // Find the shelf ID for this window. | |
432 ShelfID shelf_id = window_id_to_shelf_id_[window_id]; | |
433 DCHECK_GT(shelf_id, 0); | |
434 | |
435 // Update the icon in the ShelfItem. | |
436 int index = model_->ItemIndexByID(shelf_id); | |
437 DCHECK_GE(index, 0); | |
438 ShelfItem item = *model_->ItemByID(shelf_id); | |
439 item.image = GetShelfIconFromSerializedBitmap(app_icon); | |
440 model_->Set(index, item); | |
441 } | |
442 | |
443 void ShelfDelegateMus::OnUserWindowFocusChanged(uint32_t window_id, | |
444 bool has_focus) { | |
445 if (!window_id_to_shelf_id_.count(window_id)) | |
446 return; | |
447 ShelfID shelf_id = window_id_to_shelf_id_[window_id]; | |
448 int index = model_->ItemIndexByID(shelf_id); | |
449 DCHECK_GE(index, 0); | |
450 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id); | |
451 DCHECK(iter != model_->items().end()); | |
452 ShelfItem item = *iter; | |
453 item.status = has_focus ? STATUS_ACTIVE : STATUS_RUNNING; | |
454 model_->Set(index, item); | |
455 } | |
456 | |
457 void ShelfDelegateMus::SetShelfPreferredSizes(Shelf* shelf) { | 332 void ShelfDelegateMus::SetShelfPreferredSizes(Shelf* shelf) { |
458 ShelfWidget* widget = shelf->shelf_widget(); | 333 ShelfWidget* widget = shelf->shelf_widget(); |
459 ShelfLayoutManager* layout_manager = widget->shelf_layout_manager(); | 334 ShelfLayoutManager* layout_manager = widget->shelf_layout_manager(); |
460 ui::Window* window = aura::GetMusWindow(widget->GetNativeWindow()); | 335 ui::Window* window = aura::GetMusWindow(widget->GetNativeWindow()); |
461 gfx::Size size = layout_manager->GetPreferredSize(); | 336 gfx::Size size = layout_manager->GetPreferredSize(); |
462 window->SetSharedProperty<gfx::Size>( | 337 window->SetSharedProperty<gfx::Size>( |
463 ui::mojom::WindowManager::kPreferredSize_Property, size); | 338 ui::mojom::WindowManager::kPreferredSize_Property, size); |
464 | 339 |
465 StatusAreaWidget* status_widget = widget->status_area_widget(); | 340 StatusAreaWidget* status_widget = widget->status_area_widget(); |
466 ui::Window* status_window = | 341 ui::Window* status_window = |
467 aura::GetMusWindow(status_widget->GetNativeWindow()); | 342 aura::GetMusWindow(status_widget->GetNativeWindow()); |
468 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size(); | 343 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size(); |
469 status_window->SetSharedProperty<gfx::Size>( | 344 status_window->SetSharedProperty<gfx::Size>( |
470 ui::mojom::WindowManager::kPreferredSize_Property, status_size); | 345 ui::mojom::WindowManager::kPreferredSize_Property, status_size); |
471 } | 346 } |
472 | 347 |
473 } // namespace sysui | 348 } // namespace sysui |
474 } // namespace ash | 349 } // namespace ash |
OLD | NEW |