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 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_WIN_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_WIN_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.h" | 9 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.h" |
10 | 10 |
11 namespace web_app { | 11 namespace web_app { |
12 struct ShortcutInfo; | 12 struct ShortcutInfo; |
13 } | 13 } |
14 | 14 |
15 class GlassAppWindowFrameViewWin; | 15 class GlassAppWindowFrameViewWin; |
16 | 16 |
17 // Windows-specific parts of the views-backed native shell window implementation | 17 // Windows-specific parts of the views-backed native shell window implementation |
18 // for packaged apps. | 18 // for packaged apps. |
19 class ChromeNativeAppWindowViewsWin : public ChromeNativeAppWindowViewsAura { | 19 class ChromeNativeAppWindowViewsWin : public ChromeNativeAppWindowViewsAura { |
20 public: | 20 public: |
21 ChromeNativeAppWindowViewsWin(); | 21 ChromeNativeAppWindowViewsWin(); |
22 ~ChromeNativeAppWindowViewsWin() override; | 22 ~ChromeNativeAppWindowViewsWin() override; |
23 | 23 |
24 GlassAppWindowFrameViewWin* glass_frame_view() { | 24 GlassAppWindowFrameViewWin* glass_frame_view() { |
25 return glass_frame_view_; | 25 return glass_frame_view_; |
26 } | 26 } |
27 | 27 |
28 private: | 28 private: |
29 void ActivateParentDesktopIfNecessary(); | |
30 | |
31 void OnShortcutInfoLoaded( | 29 void OnShortcutInfoLoaded( |
32 const web_app::ShortcutInfo& shortcut_info); | 30 const web_app::ShortcutInfo& shortcut_info); |
33 | 31 |
34 HWND GetNativeAppWindowHWND() const; | 32 HWND GetNativeAppWindowHWND() const; |
35 bool IsRunningInAsh(); | 33 bool IsRunningInAsh(); |
36 void EnsureCaptionStyleSet(); | 34 void EnsureCaptionStyleSet(); |
37 | 35 |
38 // Overridden from ChromeNativeAppWindowViews: | 36 // Overridden from ChromeNativeAppWindowViews: |
39 void OnBeforeWidgetInit( | 37 void OnBeforeWidgetInit( |
40 const extensions::AppWindow::CreateParams& create_params, | 38 const extensions::AppWindow::CreateParams& create_params, |
41 views::Widget::InitParams* init_params, | 39 views::Widget::InitParams* init_params, |
42 views::Widget* widget) override; | 40 views::Widget* widget) override; |
43 void InitializeDefaultWindow( | 41 void InitializeDefaultWindow( |
44 const extensions::AppWindow::CreateParams& create_params) override; | 42 const extensions::AppWindow::CreateParams& create_params) override; |
45 views::NonClientFrameView* CreateStandardDesktopAppFrame() override; | 43 views::NonClientFrameView* CreateStandardDesktopAppFrame() override; |
46 | 44 |
47 // Overridden from ui::BaseWindow: | |
48 void Show() override; | |
49 void Activate() override; | |
50 | |
51 // Overridden from views::WidgetDelegate: | 45 // Overridden from views::WidgetDelegate: |
52 bool CanMinimize() const override; | 46 bool CanMinimize() const override; |
53 | 47 |
54 // Populated if there is a glass frame, which provides special information | 48 // Populated if there is a glass frame, which provides special information |
55 // to the native widget implementation. This will be NULL if there is no | 49 // to the native widget implementation. This will be NULL if there is no |
56 // glass frame. Note, this can change from NULL to non-NULL and back again | 50 // glass frame. Note, this can change from NULL to non-NULL and back again |
57 // throughout the life of a window, e.g. if DWM is enabled and disabled. | 51 // throughout the life of a window, e.g. if DWM is enabled and disabled. |
58 GlassAppWindowFrameViewWin* glass_frame_view_; | 52 GlassAppWindowFrameViewWin* glass_frame_view_; |
59 | 53 |
60 // The Windows Application User Model ID identifying the app. | 54 // The Windows Application User Model ID identifying the app. |
61 // Not set for windows running inside Ash. | 55 // Not set for windows running inside Ash. |
62 base::string16 app_model_id_; | 56 base::string16 app_model_id_; |
63 | 57 |
64 // Whether the InitParams indicated that this window should be translucent. | 58 // Whether the InitParams indicated that this window should be translucent. |
65 bool is_translucent_; | 59 bool is_translucent_; |
66 | 60 |
67 base::WeakPtrFactory<ChromeNativeAppWindowViewsWin> weak_ptr_factory_; | 61 base::WeakPtrFactory<ChromeNativeAppWindowViewsWin> weak_ptr_factory_; |
68 | 62 |
69 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViewsWin); | 63 DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViewsWin); |
70 }; | 64 }; |
71 | 65 |
72 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_WIN_H_ | 66 #endif // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_WIN_H_ |
OLD | NEW |