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

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

Issue 166443004: Add frame color option to packaged app windows. (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/app_window.h" 8 #include "apps/app_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"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 private: 85 private:
86 friend class ShapedAppWindowTargeterTest; 86 friend class ShapedAppWindowTargeterTest;
87 87
88 void InitializeDefaultWindow( 88 void InitializeDefaultWindow(
89 const apps::AppWindow::CreateParams& create_params); 89 const apps::AppWindow::CreateParams& create_params);
90 void InitializePanelWindow( 90 void InitializePanelWindow(
91 const apps::AppWindow::CreateParams& create_params); 91 const apps::AppWindow::CreateParams& create_params);
92 void OnViewWasResized(); 92 void OnViewWasResized();
93 93
94 bool ShouldUseChromeStyleFrame() const; 94 bool ShouldUseNativeFrame() const;
95 95
96 // Caller owns the returned object. 96 // Caller owns the returned object.
97 apps::AppWindowFrameView* CreateAppWindowFrameView(); 97 apps::AppWindowFrameView* CreateAppWindowFrameView();
98 98
99 #if defined(OS_WIN) 99 #if defined(OS_WIN)
100 void OnShortcutInfoLoaded( 100 void OnShortcutInfoLoaded(
101 const ShellIntegration::ShortcutInfo& shortcut_info); 101 const ShellIntegration::ShortcutInfo& shortcut_info);
102 HWND GetNativeAppWindowHWND() const; 102 HWND GetNativeAppWindowHWND() const;
103 #endif 103 #endif
104 104
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 virtual void UpdateWindowIcon() OVERRIDE; 182 virtual void UpdateWindowIcon() OVERRIDE;
183 virtual void UpdateWindowTitle() OVERRIDE; 183 virtual void UpdateWindowTitle() OVERRIDE;
184 virtual void UpdateBadgeIcon() OVERRIDE; 184 virtual void UpdateBadgeIcon() OVERRIDE;
185 virtual void UpdateDraggableRegions( 185 virtual void UpdateDraggableRegions(
186 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; 186 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE;
187 virtual SkRegion* GetDraggableRegion() OVERRIDE; 187 virtual SkRegion* GetDraggableRegion() OVERRIDE;
188 virtual void UpdateShape(scoped_ptr<SkRegion> region) OVERRIDE; 188 virtual void UpdateShape(scoped_ptr<SkRegion> region) OVERRIDE;
189 virtual void HandleKeyboardEvent( 189 virtual void HandleKeyboardEvent(
190 const content::NativeWebKeyboardEvent& event) OVERRIDE; 190 const content::NativeWebKeyboardEvent& event) OVERRIDE;
191 virtual bool IsFrameless() const OVERRIDE; 191 virtual bool IsFrameless() const OVERRIDE;
192 virtual bool HasFrameColor() const OVERRIDE;
193 virtual SkColor FrameColor() const OVERRIDE;
192 virtual gfx::Insets GetFrameInsets() const OVERRIDE; 194 virtual gfx::Insets GetFrameInsets() const OVERRIDE;
193 virtual void HideWithApp() OVERRIDE; 195 virtual void HideWithApp() OVERRIDE;
194 virtual void ShowWithApp() OVERRIDE; 196 virtual void ShowWithApp() OVERRIDE;
195 virtual void UpdateWindowMinMaxSize() OVERRIDE; 197 virtual void UpdateWindowMinMaxSize() OVERRIDE;
196 198
197 // web_modal::WebContentsModalDialogHost implementation. 199 // web_modal::WebContentsModalDialogHost implementation.
198 virtual gfx::NativeView GetHostView() const OVERRIDE; 200 virtual gfx::NativeView GetHostView() const OVERRIDE;
199 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; 201 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE;
200 virtual gfx::Size GetMaximumDialogSize() OVERRIDE; 202 virtual gfx::Size GetMaximumDialogSize() OVERRIDE;
201 virtual void AddObserver( 203 virtual void AddObserver(
202 web_modal::ModalDialogHostObserver* observer) OVERRIDE; 204 web_modal::ModalDialogHostObserver* observer) OVERRIDE;
203 virtual void RemoveObserver( 205 virtual void RemoveObserver(
204 web_modal::ModalDialogHostObserver* observer) OVERRIDE; 206 web_modal::ModalDialogHostObserver* observer) OVERRIDE;
205 207
206 content::WebContents* web_contents() { return app_window_->web_contents(); } 208 content::WebContents* web_contents() { return app_window_->web_contents(); }
207 209
208 apps::AppWindow* app_window_; // Not owned. 210 apps::AppWindow* app_window_; // Not owned.
209 views::WebView* web_view_; 211 views::WebView* web_view_;
210 views::Widget* window_; 212 views::Widget* window_;
211 bool is_fullscreen_; 213 bool is_fullscreen_;
212 214
213 // Custom shape of the window. If this is not set then the window has a 215 // Custom shape of the window. If this is not set then the window has a
214 // default shape, usually rectangular. 216 // default shape, usually rectangular.
215 scoped_ptr<SkRegion> shape_; 217 scoped_ptr<SkRegion> shape_;
216 218
217 scoped_ptr<SkRegion> draggable_region_; 219 scoped_ptr<SkRegion> draggable_region_;
218 220
219 bool frameless_; 221 bool frameless_;
222 bool has_frame_color_;
223 SkColor frame_color_;
220 bool transparent_background_; 224 bool transparent_background_;
221 gfx::Size preferred_size_; 225 gfx::Size preferred_size_;
222 bool resizable_; 226 bool resizable_;
223 227
224 // The class that registers for keyboard shortcuts for extension commands. 228 // The class that registers for keyboard shortcuts for extension commands.
225 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; 229 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_;
226 230
227 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; 231 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
228 232
229 #if defined(USE_ASH) 233 #if defined(USE_ASH)
230 // Used to put non-frameless windows into immersive fullscreen on ChromeOS. In 234 // Used to put non-frameless windows into immersive fullscreen on ChromeOS. In
231 // immersive fullscreen, the window header (title bar and window controls) 235 // immersive fullscreen, the window header (title bar and window controls)
232 // slides onscreen as an overlay when the mouse is hovered at the top of the 236 // slides onscreen as an overlay when the mouse is hovered at the top of the
233 // screen. 237 // screen.
234 scoped_ptr<ash::ImmersiveFullscreenController> 238 scoped_ptr<ash::ImmersiveFullscreenController>
235 immersive_fullscreen_controller_; 239 immersive_fullscreen_controller_;
236 #endif 240 #endif
237 241
238 ObserverList<web_modal::ModalDialogHostObserver> observer_list_; 242 ObserverList<web_modal::ModalDialogHostObserver> observer_list_;
239 243
240 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; 244 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_;
241 245
242 // Used to show the system menu. 246 // Used to show the system menu.
243 scoped_ptr<views::MenuRunner> menu_runner_; 247 scoped_ptr<views::MenuRunner> menu_runner_;
244 248
245 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); 249 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews);
246 }; 250 };
247 251
248 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ 252 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698