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

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

Issue 6823055: Consolidate OnKeyEvent and InputMethod code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore IME call in accelerator_handler_touch.cc. Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « views/widget/widget.h ('k') | views/widget/widget_gtk.h » ('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/widget.h" 5 #include "views/widget/widget.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "ui/gfx/compositor/compositor.h" 9 #include "ui/gfx/compositor/compositor.h"
10 #include "views/focus/view_storage.h" 10 #include "views/focus/view_storage.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 313
314 bool Widget::HasFocusManager() const { 314 bool Widget::HasFocusManager() const {
315 return !!focus_manager_.get(); 315 return !!focus_manager_.get();
316 } 316 }
317 317
318 void Widget::OnNativeWidgetPaint(gfx::Canvas* canvas) { 318 void Widget::OnNativeWidgetPaint(gfx::Canvas* canvas) {
319 GetRootView()->Paint(canvas); 319 GetRootView()->Paint(canvas);
320 RefreshCompositeTree(); 320 RefreshCompositeTree();
321 } 321 }
322 322
323 bool Widget::OnKeyEvent(const KeyEvent& event) {
324 return GetRootView()->OnKeyEvent(event);
325 }
326
323 bool Widget::OnMouseEvent(const MouseEvent& event) { 327 bool Widget::OnMouseEvent(const MouseEvent& event) {
324 switch (event.type()) { 328 switch (event.type()) {
325 case ui::ET_MOUSE_PRESSED: 329 case ui::ET_MOUSE_PRESSED:
326 last_mouse_event_was_move_ = false; 330 last_mouse_event_was_move_ = false;
327 if (GetRootView()->OnMousePressed(event)) { 331 if (GetRootView()->OnMousePressed(event)) {
328 is_mouse_button_pressed_ = true; 332 is_mouse_button_pressed_ = true;
329 if (!native_widget_->HasMouseCapture()) 333 if (!native_widget_->HasMouseCapture())
330 native_widget_->SetMouseCapture(); 334 native_widget_->SetMouseCapture();
331 return true; 335 return true;
332 } 336 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 compositor_ = ui::Compositor::Create(widget); 446 compositor_ = ui::Compositor::Create(widget);
443 447
444 return compositor_.get() != NULL; 448 return compositor_.get() != NULL;
445 } 449 }
446 450
447 bool Widget::ShouldReleaseCaptureOnMouseReleased() const { 451 bool Widget::ShouldReleaseCaptureOnMouseReleased() const {
448 return true; 452 return true;
449 } 453 }
450 454
451 } // namespace views 455 } // namespace views
OLDNEW
« no previous file with comments | « views/widget/widget.h ('k') | views/widget/widget_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698