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

Side by Side Diff: ui/aura/window_unittest.cc

Issue 944763002: Make Page Visibility API work when the browser window is visible or not Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove the VisibilityNotify event handler Created 5 years, 9 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 "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 } 1810 }
1811 transform_notifications_.clear(); 1811 transform_notifications_.clear();
1812 return result; 1812 return result;
1813 } 1813 }
1814 1814
1815 private: 1815 private:
1816 void OnWindowAdded(Window* new_window) override { added_count_++; } 1816 void OnWindowAdded(Window* new_window) override { added_count_++; }
1817 1817
1818 void OnWillRemoveWindow(Window* window) override { removed_count_++; } 1818 void OnWillRemoveWindow(Window* window) override { removed_count_++; }
1819 1819
1820 void OnWindowVisibilityChanged(Window* window, bool visible) override { 1820 void OnWindowVisibilityChanged(Window* window, bool visible,
1821 bool content_visible) override {
1821 if (!visibility_info_) { 1822 if (!visibility_info_) {
1822 visibility_info_.reset(new VisibilityInfo); 1823 visibility_info_.reset(new VisibilityInfo);
1823 visibility_info_->changed_count = 0; 1824 visibility_info_->changed_count = 0;
1824 } 1825 }
1825 visibility_info_->window_visible = window->IsVisible(); 1826 visibility_info_->window_visible = window->IsVisible();
1826 visibility_info_->visible_param = visible; 1827 visibility_info_->visible_param = visible;
1827 visibility_info_->changed_count++; 1828 visibility_info_->changed_count++;
1828 } 1829 }
1829 1830
1830 void OnWindowDestroyed(Window* window) override { 1831 void OnWindowDestroyed(Window* window) override {
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after
3590 3591
3591 EXPECT_TRUE(animator.get()); 3592 EXPECT_TRUE(animator.get());
3592 EXPECT_FALSE(animator->is_animating()); 3593 EXPECT_FALSE(animator->is_animating());
3593 EXPECT_TRUE(observer.animation_completed()); 3594 EXPECT_TRUE(observer.animation_completed());
3594 EXPECT_FALSE(observer.animation_aborted()); 3595 EXPECT_FALSE(observer.animation_aborted());
3595 animator->RemoveObserver(&observer); 3596 animator->RemoveObserver(&observer);
3596 } 3597 }
3597 3598
3598 } // namespace test 3599 } // namespace test
3599 } // namespace aura 3600 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698