Add 'disable-auto-hide-cursor' option

This commit is contained in:
Cheng Zhao 2015-04-27 12:08:22 +08:00
parent 3a50c9e48c
commit c6cf91d11f
3 changed files with 10 additions and 0 deletions

View file

@ -152,6 +152,7 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
bool enable_larger_than_screen_; bool enable_larger_than_screen_;
} }
@property BOOL acceptsFirstMouse; @property BOOL acceptsFirstMouse;
@property BOOL disableAutoHideCursor;
- (void)setShell:(atom::NativeWindowMac*)shell; - (void)setShell:(atom::NativeWindowMac*)shell;
- (void)setEnableLargerThanScreen:(bool)enable; - (void)setEnableLargerThanScreen:(bool)enable;
@end @end
@ -347,6 +348,11 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents,
options.Get(switches::kAcceptFirstMouse, &acceptsFirstMouse); options.Get(switches::kAcceptFirstMouse, &acceptsFirstMouse);
[window_ setAcceptsFirstMouse:acceptsFirstMouse]; [window_ setAcceptsFirstMouse:acceptsFirstMouse];
// Disable auto-hiding cursor.
bool disableAutoHideCursor = false;
options.Get(switches::kDisableAutoHideCursor, &disableAutoHideCursor);
[window_ setDisableAutoHideCursor:disableAutoHideCursor];
// Disable fullscreen button when 'fullscreen' is specified to false. // Disable fullscreen button when 'fullscreen' is specified to false.
bool fullscreen; bool fullscreen;
if (!(options.Get(switches::kFullscreen, &fullscreen) && if (!(options.Get(switches::kFullscreen, &fullscreen) &&

View file

@ -75,6 +75,9 @@ const char kTransparent[] = "transparent";
// Window type hint. // Window type hint.
const char kType[] = "type"; const char kType[] = "type";
// Disable auto-hiding cursor.
const char kDisableAutoHideCursor[] = "disable-auto-hide-cursor";
// Web runtime features. // Web runtime features.
const char kExperimentalFeatures[] = "experimental-features"; const char kExperimentalFeatures[] = "experimental-features";
const char kExperimentalCanvasFeatures[] = "experimental-canvas-features"; const char kExperimentalCanvasFeatures[] = "experimental-canvas-features";

View file

@ -41,6 +41,7 @@ extern const char kGuestInstanceID[];
extern const char kPreloadScript[]; extern const char kPreloadScript[];
extern const char kTransparent[]; extern const char kTransparent[];
extern const char kType[]; extern const char kType[];
extern const char kDisableAutoHideCursor[];
extern const char kExperimentalFeatures[]; extern const char kExperimentalFeatures[];
extern const char kExperimentalCanvasFeatures[]; extern const char kExperimentalCanvasFeatures[];