OLD | NEW |
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/scoped_target_root_window.h" | 5 #include "ash/scoped_target_root_window.h" |
6 #include "ash/screen_util.h" | 6 #include "ash/screen_util.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "ash/test/test_shell_delegate.h" | 9 #include "ash/test/test_shell_delegate.h" |
10 #include "ash/wm/window_positioner.h" | 10 #include "ash/wm/window_positioner.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 class TestBrowserWindowAura : public TestBrowserWindow { | 34 class TestBrowserWindowAura : public TestBrowserWindow { |
35 public: | 35 public: |
36 // |native_window| will still be owned by the caller after the constructor | 36 // |native_window| will still be owned by the caller after the constructor |
37 // was called. | 37 // was called. |
38 explicit TestBrowserWindowAura(aura::Window* native_window) | 38 explicit TestBrowserWindowAura(aura::Window* native_window) |
39 : native_window_(native_window) { | 39 : native_window_(native_window) { |
40 } | 40 } |
41 virtual ~TestBrowserWindowAura() {} | 41 virtual ~TestBrowserWindowAura() {} |
42 | 42 |
43 // TestBrowserWindow overrides: | 43 // TestBrowserWindow overrides: |
44 virtual void Show() OVERRIDE { | 44 virtual void Show() override { |
45 native_window_->Show(); | 45 native_window_->Show(); |
46 Activate(); | 46 Activate(); |
47 } | 47 } |
48 virtual void Hide() OVERRIDE { | 48 virtual void Hide() override { |
49 native_window_->Hide(); | 49 native_window_->Hide(); |
50 } | 50 } |
51 virtual void Activate() OVERRIDE { | 51 virtual void Activate() override { |
52 aura::client::GetActivationClient( | 52 aura::client::GetActivationClient( |
53 native_window_->GetRootWindow())->ActivateWindow(native_window_.get()); | 53 native_window_->GetRootWindow())->ActivateWindow(native_window_.get()); |
54 } | 54 } |
55 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE { | 55 virtual gfx::NativeWindow GetNativeWindow() override { |
56 return native_window_.get(); | 56 return native_window_.get(); |
57 } | 57 } |
58 virtual gfx::Rect GetBounds() const OVERRIDE { | 58 virtual gfx::Rect GetBounds() const override { |
59 return native_window_->bounds(); | 59 return native_window_->bounds(); |
60 } | 60 } |
61 | 61 |
62 Browser* browser() { return browser_.get(); } | 62 Browser* browser() { return browser_.get(); } |
63 | 63 |
64 void CreateBrowser(const Browser::CreateParams& params) { | 64 void CreateBrowser(const Browser::CreateParams& params) { |
65 Browser::CreateParams create_params = params; | 65 Browser::CreateParams create_params = params; |
66 create_params.window = this; | 66 create_params.window = this; |
67 browser_.reset(new Browser(create_params)); | 67 browser_.reset(new Browser(create_params)); |
68 if (browser_->is_type_tabbed() || browser_->is_app()) { | 68 if (browser_->is_type_tabbed() || browser_->is_app()) { |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 p1600x1200)); | 1004 p1600x1200)); |
1005 // A popup that is sized to occupy the whole work area has default state. | 1005 // A popup that is sized to occupy the whole work area has default state. |
1006 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, | 1006 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, |
1007 GetWindowShowState(ui::SHOW_STATE_DEFAULT, | 1007 GetWindowShowState(ui::SHOW_STATE_DEFAULT, |
1008 ui::SHOW_STATE_NORMAL, | 1008 ui::SHOW_STATE_NORMAL, |
1009 BOTH, | 1009 BOTH, |
1010 trusted_popup->browser(), | 1010 trusted_popup->browser(), |
1011 p1600x1200, | 1011 p1600x1200, |
1012 p1600x1200)); | 1012 p1600x1200)); |
1013 } | 1013 } |
OLD | NEW |