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 "mash/simple_wm/simple_wm.h" | 5 #include "mash/simple_wm/simple_wm.h" |
6 | 6 |
7 #include "base/observer_list.h" | 7 #include "base/observer_list.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "mash/simple_wm/move_event_handler.h" | 9 #include "mash/simple_wm/move_event_handler.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 }; | 39 }; |
40 | 40 |
41 class SimpleWM::WindowListModel : public aura::WindowObserver { | 41 class SimpleWM::WindowListModel : public aura::WindowObserver { |
42 public: | 42 public: |
43 explicit WindowListModel(aura::Window* window_container) | 43 explicit WindowListModel(aura::Window* window_container) |
44 : window_container_(window_container) { | 44 : window_container_(window_container) { |
45 window_container_->AddObserver(this); | 45 window_container_->AddObserver(this); |
46 } | 46 } |
47 ~WindowListModel() override { | 47 ~WindowListModel() override { |
48 window_container_->RemoveObserver(this); | 48 window_container_->RemoveObserver(this); |
49 for (auto window : windows_) | 49 for (auto* window : windows_) |
50 window->RemoveObserver(this); | 50 window->RemoveObserver(this); |
51 } | 51 } |
52 | 52 |
53 size_t GetSize() const { | 53 size_t GetSize() const { |
54 return windows_.size(); | 54 return windows_.size(); |
55 } | 55 } |
56 base::string16 GetTitle(size_t index) const { | 56 base::string16 GetTitle(size_t index) const { |
57 return windows_.at(index)->GetTitle(); | 57 return windows_.at(index)->GetTitle(); |
58 } | 58 } |
59 aura::Window* GetWindow(size_t index) const { | 59 aura::Window* GetWindow(size_t index) const { |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 } | 576 } |
577 | 577 |
578 void SimpleWM::OnWindowListViewItemActivated(aura::Window* window) { | 578 void SimpleWM::OnWindowListViewItemActivated(aura::Window* window) { |
579 window->Show(); | 579 window->Show(); |
580 aura::client::ActivationClient* activation_client = | 580 aura::client::ActivationClient* activation_client = |
581 aura::client::GetActivationClient(window->GetRootWindow()); | 581 aura::client::GetActivationClient(window->GetRootWindow()); |
582 activation_client->ActivateWindow(window); | 582 activation_client->ActivateWindow(window); |
583 } | 583 } |
584 | 584 |
585 } // namespace simple_wm | 585 } // namespace simple_wm |
OLD | NEW |