OLD | NEW |
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 "extensions/shell/browser/shell_native_app_window_aura.h" | 5 #include "extensions/shell/browser/shell_native_app_window_aura.h" |
6 | 6 |
7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 #include "ui/aura/window_tree_host.h" | 9 #include "ui/aura/window_tree_host.h" |
10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 } | 37 } |
38 | 38 |
39 gfx::NativeWindow ShellNativeAppWindowAura::GetNativeWindow() const { | 39 gfx::NativeWindow ShellNativeAppWindowAura::GetNativeWindow() const { |
40 return app_window()->web_contents()->GetNativeView(); | 40 return app_window()->web_contents()->GetNativeView(); |
41 } | 41 } |
42 | 42 |
43 gfx::Rect ShellNativeAppWindowAura::GetBounds() const { | 43 gfx::Rect ShellNativeAppWindowAura::GetBounds() const { |
44 return GetNativeWindow()->GetBoundsInScreen(); | 44 return GetNativeWindow()->GetBoundsInScreen(); |
45 } | 45 } |
46 | 46 |
47 void ShellNativeAppWindowAura::Show() { | 47 void ShellNativeAppWindowAura::Show(bool user_gesture) { |
48 GetNativeWindow()->Show(); | 48 GetNativeWindow()->Show(); |
49 } | 49 } |
50 | 50 |
51 void ShellNativeAppWindowAura::Hide() { | 51 void ShellNativeAppWindowAura::Hide() { |
52 GetNativeWindow()->Hide(); | 52 GetNativeWindow()->Hide(); |
53 } | 53 } |
54 | 54 |
55 void ShellNativeAppWindowAura::Activate(bool user_gesture) { | 55 void ShellNativeAppWindowAura::Activate(bool user_gesture) { |
56 aura::Window* window = GetNativeWindow(); | 56 aura::Window* window = GetNativeWindow(); |
57 if (window) | 57 if (window) |
58 wm::ActivateWindow(window); | 58 wm::ActivateWindow(window); |
59 } | 59 } |
60 | 60 |
61 void ShellNativeAppWindowAura::Deactivate() { | 61 void ShellNativeAppWindowAura::Deactivate() { |
62 aura::Window* window = GetNativeWindow(); | 62 aura::Window* window = GetNativeWindow(); |
63 if (window) | 63 if (window) |
64 wm::DeactivateWindow(window); | 64 wm::DeactivateWindow(window); |
65 } | 65 } |
66 | 66 |
67 void ShellNativeAppWindowAura::SetBounds(const gfx::Rect& bounds) { | 67 void ShellNativeAppWindowAura::SetBounds(const gfx::Rect& bounds) { |
68 GetNativeWindow()->SetBounds(bounds); | 68 GetNativeWindow()->SetBounds(bounds); |
69 } | 69 } |
70 | 70 |
71 } // namespace extensions | 71 } // namespace extensions |
OLD | NEW |