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

Side by Side Diff: chrome/browser/ui/views/apps/native_app_window_views.h

Issue 161753002: Move Windows-specific code into NativeAppWindowViewsWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_NATIVE_APP_WINDOW_VIEWS_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ 6 #define CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_
7 7
8 #include "apps/shell_window.h" 8 #include "apps/shell_window.h"
9 #include "apps/ui/native_app_window.h" 9 #include "apps/ui/native_app_window.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
11 #include "content/public/browser/web_contents_observer.h" 11 #include "content/public/browser/web_contents_observer.h"
12 #include "third_party/skia/include/core/SkRegion.h" 12 #include "third_party/skia/include/core/SkRegion.h"
13 #include "ui/gfx/image/image_skia.h" 13 #include "ui/gfx/image/image_skia.h"
14 #include "ui/gfx/rect.h" 14 #include "ui/gfx/rect.h"
15 #include "ui/views/context_menu_controller.h" 15 #include "ui/views/context_menu_controller.h"
16 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" 16 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h"
17 #include "ui/views/widget/widget.h" 17 #include "ui/views/widget/widget.h"
18 #include "ui/views/widget/widget_delegate.h" 18 #include "ui/views/widget/widget_delegate.h"
19 #include "ui/views/widget/widget_observer.h" 19 #include "ui/views/widget/widget_observer.h"
20 20
21 #if defined(OS_WIN)
22 #include "chrome/browser/shell_integration.h"
23 #endif
24
25 #if defined(USE_ASH) 21 #if defined(USE_ASH)
26 namespace ash { 22 namespace ash {
27 class ImmersiveFullscreenController; 23 class ImmersiveFullscreenController;
28 } 24 }
29 #endif 25 #endif
30 26
31 class ExtensionKeybindingRegistryViews; 27 class ExtensionKeybindingRegistryViews;
32 class Profile; 28 class Profile;
33 29
34 namespace apps { 30 namespace apps {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 views::Widget* widget); 69 views::Widget* widget);
74 70
75 // ui::BaseWindow implementation that subclasses may override. 71 // ui::BaseWindow implementation that subclasses may override.
76 virtual void Show() OVERRIDE; 72 virtual void Show() OVERRIDE;
77 virtual void Activate() OVERRIDE; 73 virtual void Activate() OVERRIDE;
78 74
79 Profile* profile() { return shell_window_->profile(); } 75 Profile* profile() { return shell_window_->profile(); }
80 const extensions::Extension* extension() { 76 const extensions::Extension* extension() {
81 return shell_window_->extension(); 77 return shell_window_->extension();
82 } 78 }
79 const views::Widget* window() const { return window_; }
80
81 virtual void InitializeDefaultWindow(
82 const apps::ShellWindow::CreateParams& create_params);
83 virtual void InitializePanelWindow(
84 const apps::ShellWindow::CreateParams& create_params);
83 85
84 private: 86 private:
85 friend class ShapedAppWindowTargeterTest; 87 friend class ShapedAppWindowTargeterTest;
86 88
87 void InitializeDefaultWindow(
88 const apps::ShellWindow::CreateParams& create_params);
89 void InitializePanelWindow(
90 const apps::ShellWindow::CreateParams& create_params);
91 void OnViewWasResized(); 89 void OnViewWasResized();
92 90
93 bool ShouldUseChromeStyleFrame() const; 91 bool ShouldUseChromeStyleFrame() const;
94 92
95 // Caller owns the returned object. 93 // Caller owns the returned object.
96 apps::ShellWindowFrameView* CreateShellWindowFrameView(); 94 apps::ShellWindowFrameView* CreateShellWindowFrameView();
97 95
98 #if defined(OS_WIN)
99 void OnShortcutInfoLoaded(
100 const ShellIntegration::ShortcutInfo& shortcut_info);
101 HWND GetNativeAppWindowHWND() const;
102 #endif
103
104 // ui::BaseWindow implementation. 96 // ui::BaseWindow implementation.
105 virtual bool IsActive() const OVERRIDE; 97 virtual bool IsActive() const OVERRIDE;
106 virtual bool IsMaximized() const OVERRIDE; 98 virtual bool IsMaximized() const OVERRIDE;
107 virtual bool IsMinimized() const OVERRIDE; 99 virtual bool IsMinimized() const OVERRIDE;
108 virtual bool IsFullscreen() const OVERRIDE; 100 virtual bool IsFullscreen() const OVERRIDE;
109 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; 101 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
110 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; 102 virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
111 virtual ui::WindowShowState GetRestoredState() const OVERRIDE; 103 virtual ui::WindowShowState GetRestoredState() const OVERRIDE;
112 virtual gfx::Rect GetBounds() const OVERRIDE; 104 virtual gfx::Rect GetBounds() const OVERRIDE;
113 virtual void ShowInactive() OVERRIDE; 105 virtual void ShowInactive() OVERRIDE;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 231
240 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; 232 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_;
241 233
242 // Used to show the system menu. 234 // Used to show the system menu.
243 scoped_ptr<views::MenuRunner> menu_runner_; 235 scoped_ptr<views::MenuRunner> menu_runner_;
244 236
245 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); 237 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews);
246 }; 238 };
247 239
248 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ 240 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698