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

Side by Side Diff: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h

Issue 916833005: [Mac] Use a custom view to implement colored app windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 5 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_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ 6 #define CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 25 matching lines...) Expand all
36 @property(assign, nonatomic) NativeAppWindowCocoa* appWindow; 36 @property(assign, nonatomic) NativeAppWindowCocoa* appWindow;
37 37
38 // Consults the Command Registry to see if this |event| needs to be handled as 38 // Consults the Command Registry to see if this |event| needs to be handled as
39 // an extension command and returns YES if so (NO otherwise). 39 // an extension command and returns YES if so (NO otherwise).
40 // Only extensions with the given |priority| are considered. 40 // Only extensions with the given |priority| are considered.
41 - (BOOL)handledByExtensionCommand:(NSEvent*)event 41 - (BOOL)handledByExtensionCommand:(NSEvent*)event
42 priority:(ui::AcceleratorManager::HandlerPriority)priority; 42 priority:(ui::AcceleratorManager::HandlerPriority)priority;
43 43
44 @end 44 @end
45 45
46 // A view that paints a solid color. Used to change the title bar background.
47 @interface TitlebarBackgroundView : NSView {
tapted 2015/02/19 03:11:02 forward declare this? i.e. just `@class TitlebarBa
jackhou1 2015/02/19 04:28:58 Done.
48 @private
49 base::scoped_nsobject<NSColor> color_;
50 base::scoped_nsobject<NSColor> inactiveColor_;
51 }
52 - (void)setColor:(NSColor*)color
53 inactiveColor:(NSColor*)inactiveColor;
tapted 2015/02/19 03:11:02 nit: minimum 4 space indent (colons are allowed to
jackhou1 2015/02/19 04:28:58 Done.
54 @end
55
46 // Cocoa bridge to AppWindow. 56 // Cocoa bridge to AppWindow.
47 class NativeAppWindowCocoa : public extensions::NativeAppWindow, 57 class NativeAppWindowCocoa : public extensions::NativeAppWindow,
48 public content::WebContentsObserver { 58 public content::WebContentsObserver {
49 public: 59 public:
50 NativeAppWindowCocoa(extensions::AppWindow* app_window, 60 NativeAppWindowCocoa(extensions::AppWindow* app_window,
51 const extensions::AppWindow::CreateParams& params); 61 const extensions::AppWindow::CreateParams& params);
52 62
53 // ui::BaseWindow implementation. 63 // ui::BaseWindow implementation.
54 bool IsActive() const override; 64 bool IsActive() const override;
55 bool IsMaximized() const override; 65 bool IsMaximized() const override;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 bool shows_resize_controls_; 209 bool shows_resize_controls_;
200 bool shows_fullscreen_controls_; 210 bool shows_fullscreen_controls_;
201 211
202 extensions::SizeConstraints size_constraints_; 212 extensions::SizeConstraints size_constraints_;
203 213
204 bool has_frame_color_; 214 bool has_frame_color_;
205 SkColor active_frame_color_; 215 SkColor active_frame_color_;
206 SkColor inactive_frame_color_; 216 SkColor inactive_frame_color_;
207 217
208 base::scoped_nsobject<NativeAppWindowController> window_controller_; 218 base::scoped_nsobject<NativeAppWindowController> window_controller_;
219 base::scoped_nsobject<TitlebarBackgroundView> titlebar_background_view_;
209 220
210 // For system drag, the whole window is draggable and the non-draggable areas 221 // For system drag, the whole window is draggable and the non-draggable areas
211 // have to been explicitly excluded. 222 // have to been explicitly excluded.
212 std::vector<extensions::DraggableRegion> draggable_regions_; 223 std::vector<extensions::DraggableRegion> draggable_regions_;
213 224
214 // The Extension Command Registry used to determine which keyboard events to 225 // The Extension Command Registry used to determine which keyboard events to
215 // handle. 226 // handle.
216 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; 227 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_;
217 228
218 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); 229 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa);
219 }; 230 };
220 231
221 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ 232 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698