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

Side by Side Diff: views/widget/native_widget_gtk.cc

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « views/views.gyp ('k') | views/widget/native_widget_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "views/widget/native_widget_gtk.h" 5 #include "views/widget/native_widget_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 #include <X11/extensions/shape.h> 9 #include <X11/extensions/shape.h>
10 #include <X11/Xatom.h> 10 #include <X11/Xatom.h>
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 // VKEY_MENU is triggered by key release event. 607 // VKEY_MENU is triggered by key release event.
608 // FocusManager::OnKeyEvent() returns false when the key has been consumed. 608 // FocusManager::OnKeyEvent() returns false when the key has been consumed.
609 if (key_code != ui::VKEY_MENU) 609 if (key_code != ui::VKEY_MENU)
610 handled = !GetWidget()->GetFocusManager()->OnKeyEvent(key); 610 handled = !GetWidget()->GetFocusManager()->OnKeyEvent(key);
611 else 611 else
612 should_handle_menu_key_release_ = true; 612 should_handle_menu_key_release_ = true;
613 } else if (key_code == ui::VKEY_MENU && should_handle_menu_key_release_ && 613 } else if (key_code == ui::VKEY_MENU && should_handle_menu_key_release_ &&
614 (key.flags() & ~ui::EF_ALT_DOWN) == 0) { 614 (key.flags() & ~ui::EF_ALT_DOWN) == 0) {
615 // Trigger VKEY_MENU when only this key is pressed and released, and both 615 // Trigger VKEY_MENU when only this key is pressed and released, and both
616 // press and release events are not handled by others. 616 // press and release events are not handled by others.
617 Accelerator accelerator(ui::VKEY_MENU, false, false, false); 617 ui::Accelerator accelerator(ui::VKEY_MENU, false, false, false);
618 handled = GetWidget()->GetFocusManager()->ProcessAccelerator(accelerator); 618 handled = GetWidget()->GetFocusManager()->ProcessAccelerator(accelerator);
619 } 619 }
620 620
621 return handled; 621 return handled;
622 } 622 }
623 623
624 bool NativeWidgetGtk::SuppressFreezeUpdates() { 624 bool NativeWidgetGtk::SuppressFreezeUpdates() {
625 if (!painted_) { 625 if (!painted_) {
626 painted_ = true; 626 painted_ = true;
627 return true; 627 return true;
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 button_pressed = event->type == GDK_BUTTON_PRESS || 2316 button_pressed = event->type == GDK_BUTTON_PRESS ||
2317 event->type == GDK_2BUTTON_PRESS || 2317 event->type == GDK_2BUTTON_PRESS ||
2318 event->type == GDK_3BUTTON_PRESS; 2318 event->type == GDK_3BUTTON_PRESS;
2319 gdk_event_free(event); 2319 gdk_event_free(event);
2320 } 2320 }
2321 return button_pressed; 2321 return button_pressed;
2322 } 2322 }
2323 2323
2324 } // namespace internal 2324 } // namespace internal
2325 } // namespace views 2325 } // namespace views
OLDNEW
« no previous file with comments | « views/views.gyp ('k') | views/widget/native_widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698