summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 00:11:40 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 00:11:40 +0000
commitb4d13c652373433d8f6b755bc68f670f187d2157 (patch)
treeb9a64ed14157f4fb6e03d040921bc9ba63f54091 /views
parent90d890d27ead80ecbbe5e861ec71ff97b459c954 (diff)
downloadchromium_src-b4d13c652373433d8f6b755bc68f670f187d2157.zip
chromium_src-b4d13c652373433d8f6b755bc68f670f187d2157.tar.gz
chromium_src-b4d13c652373433d8f6b755bc68f670f187d2157.tar.bz2
Convert LOG(INFO) to VLOG(1) - views/.
This also removes DEBUG_MENU. I don't think the extra ints are a big deal. They should be optimized away in release mode. Also fixes a spelling error and converts some silly code to using early returns. BUG=none TEST=none Review URL: http://codereview.chromium.org/3908004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63150 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/menu/menu_controller.cc39
-rw-r--r--views/controls/menu/menu_host_root_view.cc6
-rw-r--r--views/controls/menu/menu_host_win.cc6
-rw-r--r--views/touchui/gesture_manager.cc33
-rw-r--r--views/view.cc6
5 files changed, 19 insertions, 71 deletions
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc
index 06c86fc..affddeb 100644
--- a/views/controls/menu/menu_controller.cc
+++ b/views/controls/menu/menu_controller.cc
@@ -249,11 +249,6 @@ MenuController* MenuController::GetActiveInstance() {
return active_instance_;
}
-#ifdef DEBUG_MENU
-static int instance_count = 0;
-static int nested_depth = 0;
-#endif
-
MenuItemView* MenuController::Run(gfx::NativeWindow parent,
MenuButton* button,
MenuItemView* root,
@@ -298,11 +293,6 @@ MenuItemView* MenuController::Run(gfx::NativeWindow parent,
menu_button_ = button;
}
-#ifdef DEBUG_MENU
- nested_depth++;
- DLOG(INFO) << " entering nested loop, depth=" << nested_depth;
-#endif
-
// Make sure Chrome doesn't attempt to shut down while the menu is showing.
if (ViewsDelegate::views_delegate)
ViewsDelegate::views_delegate->AddRef();
@@ -320,11 +310,6 @@ MenuItemView* MenuController::Run(gfx::NativeWindow parent,
if (ViewsDelegate::views_delegate)
ViewsDelegate::views_delegate->ReleaseRef();
-#ifdef DEBUG_MENU
- nested_depth--;
- DLOG(INFO) << " exiting nested loop, depth=" << nested_depth;
-#endif
-
// Close any open menus.
SetSelection(NULL, false, true);
@@ -448,9 +433,6 @@ void MenuController::Cancel(ExitType type) {
void MenuController::OnMousePressed(SubmenuView* source,
const MouseEvent& event) {
-#ifdef DEBUG_MENU
- DLOG(INFO) << "OnMousePressed source=" << source;
-#endif
if (!blocking_run_)
return;
@@ -497,9 +479,6 @@ void MenuController::OnMousePressed(SubmenuView* source,
void MenuController::OnMouseDragged(SubmenuView* source,
const MouseEvent& event) {
-#ifdef DEBUG_MENU
- DLOG(INFO) << "OnMouseDragged source=" << source;
-#endif
MenuPart part = GetMenuPartByScreenCoordinate(source, event.x(), event.y());
UpdateScrolling(part);
@@ -557,9 +536,6 @@ void MenuController::OnMouseDragged(SubmenuView* source,
void MenuController::OnMouseReleased(SubmenuView* source,
const MouseEvent& event) {
-#ifdef DEBUG_MENU
- DLOG(INFO) << "OnMouseReleased source=" << source;
-#endif
if (!blocking_run_)
return;
@@ -608,9 +584,6 @@ void MenuController::OnMouseReleased(SubmenuView* source,
void MenuController::OnMouseMoved(SubmenuView* source,
const MouseEvent& event) {
-#ifdef DEBUG_MENU
- DLOG(INFO) << "OnMouseMoved source=" << source;
-#endif
if (showing_submenu_)
return;
@@ -974,20 +947,12 @@ MenuController::MenuController(bool blocking)
showing_submenu_(false),
menu_button_(NULL),
active_mouse_view_(NULL) {
-#ifdef DEBUG_MENU
- instance_count++;
- DLOG(INFO) << "created MC, count=" << instance_count;
-#endif
}
MenuController::~MenuController() {
DCHECK(!showing_);
StopShowTimer();
StopCancelAllTimer();
-#ifdef DEBUG_MENU
- instance_count--;
- DLOG(INFO) << "destroyed MC, count=" << instance_count;
-#endif
}
bool MenuController::SendAcceleratorToHotTrackedView() {
@@ -1674,10 +1639,6 @@ void MenuController::RepostEvent(SubmenuView* source,
View::ConvertPointToScreen(source->GetScrollViewContainer(), &screen_loc);
HWND window = WindowFromPoint(screen_loc.ToPOINT());
if (window) {
-#ifdef DEBUG_MENU
- DLOG(INFO) << "RepostEvent on press";
-#endif
-
// Release the capture.
SubmenuView* submenu = state_.item->GetRootMenuItem()->GetSubmenu();
submenu->ReleaseCapture();
diff --git a/views/controls/menu/menu_host_root_view.cc b/views/controls/menu/menu_host_root_view.cc
index d472284..0b2a971 100644
--- a/views/controls/menu/menu_host_root_view.cc
+++ b/views/controls/menu/menu_host_root_view.cc
@@ -15,9 +15,6 @@ MenuHostRootView::MenuHostRootView(Widget* widget,
submenu_(submenu),
forward_drag_to_menu_controller_(true),
suspend_events_(false) {
-#ifdef DEBUG_MENU
- DLOG(INFO) << " new MenuHostRootView " << this;
-#endif
}
bool MenuHostRootView::OnMousePressed(const MouseEvent& event) {
@@ -38,9 +35,6 @@ bool MenuHostRootView::OnMouseDragged(const MouseEvent& event) {
return true;
if (forward_drag_to_menu_controller_ && GetMenuController()) {
-#ifdef DEBUG_MENU
- DLOG(INFO) << " MenuHostRootView::OnMouseDragged source=" << submenu_;
-#endif
GetMenuController()->OnMouseDragged(submenu_, event);
return true;
}
diff --git a/views/controls/menu/menu_host_win.cc b/views/controls/menu/menu_host_win.cc
index 1bcc295..c22dcb9 100644
--- a/views/controls/menu/menu_host_win.cc
+++ b/views/controls/menu/menu_host_win.cc
@@ -100,9 +100,6 @@ void MenuHostWin::OnDestroy() {
void MenuHostWin::OnCaptureChanged(HWND hwnd) {
WidgetWin::OnCaptureChanged(hwnd);
owns_capture_ = false;
-#ifdef DEBUG_MENU
- DLOG(INFO) << "Capture changed";
-#endif
}
void MenuHostWin::OnCancelMode() {
@@ -122,9 +119,6 @@ void MenuHostWin::DoCapture() {
owns_capture_ = true;
SetCapture();
has_capture_ = true;
-#ifdef DEBUG_MENU
- DLOG(INFO) << "Doing capture";
-#endif
}
} // namespace views
diff --git a/views/touchui/gesture_manager.cc b/views/touchui/gesture_manager.cc
index 7123519..b88aa56 100644
--- a/views/touchui/gesture_manager.cc
+++ b/views/touchui/gesture_manager.cc
@@ -25,35 +25,34 @@ bool GestureManager::ProcessTouchEventForGesture(const TouchEvent& event,
bool previouslyHandled) {
// TODO(rjkroege): A realistic version of the GestureManager will
// appear in a subsequent CL. This interim version permits verifying that the
- // event distirbution code works by turning all touch inputs into
+ // event distribution code works by turning all touch inputs into
// mouse approximations.
- bool handled = false;
if (event.GetType() == Event::ET_TOUCH_PRESSED) {
- DLOG(INFO) << "GestureManager::ProcessTouchEventForGesture: " <<
- "TouchPressed\n";
+ DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchPressed";
MouseEvent mouse_event(Event::ET_MOUSE_PRESSED, event.x(), event.y(),
event.GetFlags());
source->OnMousePressed(mouse_event);
- handled = true;
- } else if (event.GetType() == Event::ET_TOUCH_RELEASED) {
- DLOG(INFO) << "GestureManager::ProcessTouchEventForGesture: " <<
- "TouchReleased\n";
+ return true;
+ }
+
+ if (event.GetType() == Event::ET_TOUCH_RELEASED) {
+ DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchReleased";
MouseEvent mouse_event(Event::ET_MOUSE_RELEASED, event.x(), event.y(),
event.GetFlags());
source->OnMouseReleased(mouse_event, false);
- handled = true;
- } else if (event.GetType() == Event::ET_TOUCH_MOVED) {
- DLOG(INFO) << "GestureManager::ProcessTouchEventForGesture: " <<
- "TouchMotion\n";
+ return true;
+ }
+
+ if (event.GetType() == Event::ET_TOUCH_MOVED) {
+ DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchMotion";
MouseEvent mouse_event(Event::ET_MOUSE_DRAGGED, event.x(), event.y(),
event.GetFlags());
source->OnMouseDragged(mouse_event);
- handled = true;
- } else {
- DLOG(INFO) << "GestureManager::ProcessTouchEventForGesture: " <<
- "unhandled event\n";
+ return true;
}
- return handled;
+
+ DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: unhandled event";
+ return false;
}
GestureManager::GestureManager() {
diff --git a/views/view.cc b/views/view.cc
index e1a5fef..739fd6c 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -988,7 +988,7 @@ void View::PrintViewHierarchyImp(int indent) {
buf << L' ';
buf << this;
- LOG(INFO) << buf.str();
+ VLOG(1) << buf.str();
std::cout << buf.str() << std::endl;
for (int i = 0, count = GetChildViewCount(); i < count; ++i)
@@ -1013,7 +1013,7 @@ void View::PrintFocusHierarchyImp(int indent) {
buf << L' ';
buf << this;
- LOG(INFO) << buf.str();
+ VLOG(1) << buf.str();
std::cout << buf.str() << std::endl;
if (GetChildViewCount() > 0)
@@ -1292,7 +1292,7 @@ void View::OnMouseExited(const MouseEvent& e) {
#if defined(TOUCH_UI)
bool View::OnTouchEvent(const TouchEvent& event) {
- DLOG(INFO) << "visited the OnTouchEvent";
+ DVLOG(1) << "visited the OnTouchEvent";
return false;
}
#endif