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

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

Issue 10939010: Cleanup: avoid foo ? true : false, part 1. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 8 years, 2 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 | « ui/views/focus/focus_search.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/widget/widget.h" 5 #include "ui/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 "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "ui/base/events/event.h" 10 #include "ui/base/events/event.h"
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 return false; 1095 return false;
1096 case ui::ET_MOUSE_RELEASED: 1096 case ui::ET_MOUSE_RELEASED:
1097 last_mouse_event_was_move_ = false; 1097 last_mouse_event_was_move_ = false;
1098 is_mouse_button_pressed_ = false; 1098 is_mouse_button_pressed_ = false;
1099 // Release capture first, to avoid confusion if OnMouseReleased blocks. 1099 // Release capture first, to avoid confusion if OnMouseReleased blocks.
1100 if (native_widget_->HasCapture() && 1100 if (native_widget_->HasCapture() &&
1101 ShouldReleaseCaptureOnMouseReleased()) { 1101 ShouldReleaseCaptureOnMouseReleased()) {
1102 native_widget_->ReleaseCapture(); 1102 native_widget_->ReleaseCapture();
1103 } 1103 }
1104 GetRootView()->OnMouseReleased(event); 1104 GetRootView()->OnMouseReleased(event);
1105 return (event.flags() & ui::EF_IS_NON_CLIENT) ? false : true; 1105 return ((event.flags() & ui::EF_IS_NON_CLIENT) == 0);
1106 case ui::ET_MOUSE_MOVED: 1106 case ui::ET_MOUSE_MOVED:
1107 case ui::ET_MOUSE_DRAGGED: 1107 case ui::ET_MOUSE_DRAGGED:
1108 if (native_widget_->HasCapture() && is_mouse_button_pressed_) { 1108 if (native_widget_->HasCapture() && is_mouse_button_pressed_) {
1109 last_mouse_event_was_move_ = false; 1109 last_mouse_event_was_move_ = false;
1110 GetRootView()->OnMouseDragged(event); 1110 GetRootView()->OnMouseDragged(event);
1111 } else if (!last_mouse_event_was_move_ || 1111 } else if (!last_mouse_event_was_move_ ||
1112 last_mouse_event_position_ != event.location()) { 1112 last_mouse_event_position_ != event.location()) {
1113 last_mouse_event_position_ = event.location(); 1113 last_mouse_event_position_ = event.location();
1114 last_mouse_event_was_move_ = true; 1114 last_mouse_event_was_move_ = true;
1115 GetRootView()->OnMouseMoved(event); 1115 GetRootView()->OnMouseMoved(event);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 1344
1345 //////////////////////////////////////////////////////////////////////////////// 1345 ////////////////////////////////////////////////////////////////////////////////
1346 // internal::NativeWidgetPrivate, NativeWidget implementation: 1346 // internal::NativeWidgetPrivate, NativeWidget implementation:
1347 1347
1348 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1348 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1349 return this; 1349 return this;
1350 } 1350 }
1351 1351
1352 } // namespace internal 1352 } // namespace internal
1353 } // namespace views 1353 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/focus/focus_search.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698