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

Unified Diff: ui/aura/desktop.cc

Issue 8465021: Add ShellAcceleratorController that managers global keyboard accelerators. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address tfarina's comments Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/desktop.h ('k') | ui/aura_shell/aura_shell.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/desktop.cc
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc
index 58eaec2eb326301adba392be383f7eb24071b472..60728b8f7ce97185afd52e4950fe4fee94c7f4b2 100644
--- a/ui/aura/desktop.cc
+++ b/ui/aura/desktop.cc
@@ -26,10 +26,7 @@
#include "ui/base/hit_test.h"
#include "ui/gfx/compositor/compositor.h"
#include "ui/gfx/compositor/layer.h"
-#include "ui/gfx/compositor/layer_animation_sequence.h"
#include "ui/gfx/compositor/layer_animator.h"
-#include "ui/gfx/compositor/screen_rotation.h"
-#include "ui/gfx/interpolated_transform.h"
using std::string;
using std::vector;
@@ -95,50 +92,6 @@ void GetEventFiltersToNotify(Window* target, EventFilters* filters) {
}
}
-#if !defined(NDEBUG)
-bool MaybeFullScreen(DesktopHost* host, KeyEvent* event) {
- if (event->key_code() == ui::VKEY_F11) {
- host->ToggleFullScreen();
- return true;
- }
- return false;
-}
-
-bool MaybeRotate(Desktop* desktop, KeyEvent* event) {
- if ((event->flags() & ui::EF_CONTROL_DOWN) &&
- event->key_code() == ui::VKEY_HOME) {
- static int i = 0;
- int delta = 0;
- switch (i) {
- case 0: delta = 90; break;
- case 1: delta = 90; break;
- case 2: delta = 90; break;
- case 3: delta = 90; break;
- case 4: delta = -90; break;
- case 5: delta = -90; break;
- case 6: delta = -90; break;
- case 7: delta = -90; break;
- case 8: delta = -90; break;
- case 9: delta = 180; break;
- case 10: delta = 180; break;
- case 11: delta = 90; break;
- case 12: delta = 180; break;
- case 13: delta = 180; break;
- }
- i = (i + 1) % 14;
- desktop->layer()->GetAnimator()->set_preemption_strategy(
- ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
- scoped_ptr<ui::LayerAnimationSequence> screen_rotation(
- new ui::LayerAnimationSequence(new ui::ScreenRotation(delta)));
- screen_rotation->AddObserver(desktop);
- desktop->layer()->GetAnimator()->ScheduleAnimation(
- screen_rotation.release());
- return true;
- }
- return false;
-}
-#endif
-
} // namespace
Desktop* Desktop::instance_ = NULL;
@@ -274,14 +227,6 @@ bool Desktop::DispatchMouseEvent(MouseEvent* event) {
}
bool Desktop::DispatchKeyEvent(KeyEvent* event) {
-#if !defined(NDEBUG)
- // TODO(beng): replace this hack with global keyboard event handlers.
- if (event->type() == ui::ET_KEY_PRESSED) {
- if (MaybeFullScreen(host_.get(), event) || MaybeRotate(this, event))
- return true;
- }
-#endif
-
if (focused_window_) {
KeyEvent translated_event(*event);
return ProcessKeyEvent(focused_window_, &translated_event);
@@ -447,6 +392,12 @@ void Desktop::SetTransform(const ui::Transform& transform) {
OnHostResized(host_->GetSize());
}
+#if !defined(NDEBUG)
+void Desktop::ToggleFullScreen() {
+ host_->ToggleFullScreen();
+}
+#endif
+
void Desktop::HandleMouseMoved(const MouseEvent& event, Window* target) {
if (target == mouse_moved_handler_)
return;
« no previous file with comments | « ui/aura/desktop.h ('k') | ui/aura_shell/aura_shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698