chrome_native_app_window_views_win.h revision 5c02ac1a9c1b504631c0a3d2b6e737b5d738bae1
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
3// found in the LICENSE file.
4
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_
7
8#include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h"
9
10namespace web_app {
11struct ShortcutInfo;
12}
13
14class GlassAppWindowFrameViewWin;
15
16// Windows-specific parts of the views-backed native shell window implementation
17// for packaged apps.
18class ChromeNativeAppWindowViewsWin : public ChromeNativeAppWindowViews {
19 public:
20  ChromeNativeAppWindowViewsWin();
21
22  GlassAppWindowFrameViewWin* glass_frame_view() {
23    return glass_frame_view_;
24  };
25
26 private:
27  void ActivateParentDesktopIfNecessary();
28
29  void OnShortcutInfoLoaded(
30      const web_app::ShortcutInfo& shortcut_info);
31
32  HWND GetNativeAppWindowHWND() const;
33
34  // Overridden from ChromeNativeAppWindowViews:
35  virtual void OnBeforeWidgetInit(views::Widget::InitParams* init_params,
36                                  views::Widget* widget) OVERRIDE;
37  virtual void InitializeDefaultWindow(
38      const apps::AppWindow::CreateParams& create_params) OVERRIDE;
39  virtual views::NonClientFrameView* CreateStandardDesktopAppFrame() OVERRIDE;
40
41  // Overridden from ui::BaseWindow:
42  virtual void Show() OVERRIDE;
43  virtual void Activate() OVERRIDE;
44
45  // Overridden from apps::NativeAppWindow:
46  virtual void UpdateShelfMenu() OVERRIDE;
47
48  base::WeakPtrFactory<ChromeNativeAppWindowViewsWin> weak_ptr_factory_;
49
50  // Populated if there is a glass frame, which provides special information
51  // to the native widget implementation. This will be NULL if there is no
52  // glass frame. Note, this can change from NULL to non-NULL and back again
53  // throughout the life of a window, e.g. if DWM is enabled and disabled.
54  GlassAppWindowFrameViewWin* glass_frame_view_;
55
56  // The Windows Application User Model ID identifying the app.
57  base::string16 app_model_id_;
58
59  DISALLOW_COPY_AND_ASSIGN(ChromeNativeAppWindowViewsWin);
60};
61
62#endif  // CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_WIN_H_
63