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

Side by Side Diff: apps/app_window.h

Issue 297123002: API proposal for chrome.app.window to intercept all keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments to explain logic behind posting instead of directly handling keyboard events. Created 6 years, 4 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 2014 The Chromium Authors. All rights reserved. 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 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 APPS_APP_WINDOW_H_ 5 #ifndef APPS_APP_WINDOW_H_
6 #define APPS_APP_WINDOW_H_ 6 #define APPS_APP_WINDOW_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 369
370 // Set whether the window should stay above other windows which are not 370 // Set whether the window should stay above other windows which are not
371 // configured to be always-on-top. 371 // configured to be always-on-top.
372 void SetAlwaysOnTop(bool always_on_top); 372 void SetAlwaysOnTop(bool always_on_top);
373 373
374 // Whether the always-on-top property has been set by the chrome.app.window 374 // Whether the always-on-top property has been set by the chrome.app.window
375 // API. Note that the actual value of this property in the native app window 375 // API. Note that the actual value of this property in the native app window
376 // may be false if the bit is silently switched off for security reasons. 376 // may be false if the bit is silently switched off for security reasons.
377 bool IsAlwaysOnTop() const; 377 bool IsAlwaysOnTop() const;
378 378
379 // Set whether the window should get even reserved keys (modulo platform
380 // restrictions).
381 void SetInterceptAllKeys(bool want_all_keys);
382
379 // Retrieve the current state of the app window as a dictionary, to pass to 383 // Retrieve the current state of the app window as a dictionary, to pass to
380 // the renderer. 384 // the renderer.
381 void GetSerializedState(base::DictionaryValue* properties) const; 385 void GetSerializedState(base::DictionaryValue* properties) const;
382 386
383 // Called by the window API when events can be sent to the window for this 387 // Called by the window API when events can be sent to the window for this
384 // app. 388 // app.
385 void WindowEventsReady(); 389 void WindowEventsReady();
386 390
387 // Whether the app window wants a transparent background. 391 // Whether the app window wants a transparent background.
388 bool requested_transparent_background() const { 392 bool requested_transparent_background() const {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 // Cache the desired value of the always-on-top property. When windows enter 589 // Cache the desired value of the always-on-top property. When windows enter
586 // fullscreen or overlap the Windows taskbar, this property will be 590 // fullscreen or overlap the Windows taskbar, this property will be
587 // automatically and silently switched off for security reasons. It is 591 // automatically and silently switched off for security reasons. It is
588 // reinstated when the window exits fullscreen and moves away from the 592 // reinstated when the window exits fullscreen and moves away from the
589 // taskbar. 593 // taskbar.
590 bool cached_always_on_top_; 594 bool cached_always_on_top_;
591 595
592 // Whether |transparent_background| was set in the CreateParams. 596 // Whether |transparent_background| was set in the CreateParams.
593 bool requested_transparent_background_; 597 bool requested_transparent_background_;
594 598
599 // Cached value of InterceptAllKeys property that is used to save/restore
600 // state as the window is active/loses focus.
601 bool cached_want_all_keys_;
602
595 DISALLOW_COPY_AND_ASSIGN(AppWindow); 603 DISALLOW_COPY_AND_ASSIGN(AppWindow);
596 }; 604 };
597 605
598 } // namespace apps 606 } // namespace apps
599 607
600 #endif // APPS_APP_WINDOW_H_ 608 #endif // APPS_APP_WINDOW_H_
OLDNEW
« no previous file with comments | « no previous file | apps/app_window.cc » ('j') | chrome/browser/apps/app_window_intercept_all_keys_uitest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698