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

Side by Side Diff: athena/wm/window_list_provider_impl_unittest.cc

Issue 641683003: C++11 override style change for athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/wm/window_list_provider_impl.h" 5 #include "athena/wm/window_list_provider_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "athena/screen/public/screen_manager.h" 9 #include "athena/screen/public/screen_manager.h"
10 #include "athena/test/base/athena_test_base.h" 10 #include "athena/test/base/athena_test_base.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 return output; 58 return output;
59 } 59 }
60 60
61 class WindowListObserver : public WindowListProviderObserver { 61 class WindowListObserver : public WindowListProviderObserver {
62 public: 62 public:
63 explicit WindowListObserver(WindowListProvider* provider) 63 explicit WindowListObserver(WindowListProvider* provider)
64 : calls_(0), window_removal_calls_(0), provider_(provider) { 64 : calls_(0), window_removal_calls_(0), provider_(provider) {
65 provider_->AddObserver(this); 65 provider_->AddObserver(this);
66 } 66 }
67 virtual ~WindowListObserver() { 67 ~WindowListObserver() override {
68 provider_->RemoveObserver(this); 68 provider_->RemoveObserver(this);
69 } 69 }
70 70
71 int calls() const { return calls_; } 71 int calls() const { return calls_; }
72 int window_removal_calls() const { return window_removal_calls_; } 72 int window_removal_calls() const { return window_removal_calls_; }
73 73
74 // WindowListProviderObserver: 74 // WindowListProviderObserver:
75 virtual void OnWindowStackingChanged() override { 75 void OnWindowStackingChanged() override {
76 calls_++; 76 calls_++;
77 } 77 }
78 78
79 virtual void OnWindowRemoved(aura::Window* removed_window, 79 void OnWindowRemoved(aura::Window* removed_window,
80 int index) override { 80 int index) override {
81 window_removal_calls_++; 81 window_removal_calls_++;
82 } 82 }
83 83
84 private: 84 private:
85 // The number of calls to the observer. 85 // The number of calls to the observer.
86 int calls_; 86 int calls_;
87 int window_removal_calls_; 87 int window_removal_calls_;
88 88
89 // The associated WindowListProvider which is observed. 89 // The associated WindowListProvider which is observed.
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 EXPECT_FALSE(t1->IsVisible()); 339 EXPECT_FALSE(t1->IsVisible());
340 w1->Show(); 340 w1->Show();
341 EXPECT_TRUE(t1->IsVisible()); 341 EXPECT_TRUE(t1->IsVisible());
342 342
343 // Resetting transient window won't notify the observer. 343 // Resetting transient window won't notify the observer.
344 t1.reset(); 344 t1.reset();
345 EXPECT_EQ(0, observer->window_removal_calls()); 345 EXPECT_EQ(0, observer->window_removal_calls());
346 } 346 }
347 347
348 } // namespace athena 348 } // namespace athena
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698