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

Side by Side Diff: apps/ui/views/shell_window_frame_view.cc

Issue 27458002: Allow setting different hit test bounds overrides for mouse and touch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « no previous file | ash/ash_switches.h » ('j') | ui/aura/window.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "apps/ui/views/shell_window_frame_view.h" 5 #include "apps/ui/views/shell_window_frame_view.h"
6 6
7 #include "apps/ui/native_app_window.h" 7 #include "apps/ui/native_app_window.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "extensions/common/draggable_region.h" 9 #include "extensions/common/draggable_region.h"
10 #include "grit/theme_resources.h" 10 #include "grit/theme_resources.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 -resize_outside_bounds_size, 114 -resize_outside_bounds_size,
115 -resize_outside_bounds_size, 115 -resize_outside_bounds_size,
116 -resize_outside_bounds_size); 116 -resize_outside_bounds_size);
117 gfx::Insets touch_insets = 117 gfx::Insets touch_insets =
118 mouse_insets.Scale(resize_outside_scale_for_touch); 118 mouse_insets.Scale(resize_outside_scale_for_touch);
119 // Ensure we get resize cursors for a few pixels outside our bounds. 119 // Ensure we get resize cursors for a few pixels outside our bounds.
120 window->SetHitTestBoundsOverrideOuter(mouse_insets, touch_insets); 120 window->SetHitTestBoundsOverrideOuter(mouse_insets, touch_insets);
121 } 121 }
122 // Ensure we get resize cursors just inside our bounds as well. 122 // Ensure we get resize cursors just inside our bounds as well.
123 // TODO(jeremya): do we need to update these when in fullscreen/maximized? 123 // TODO(jeremya): do we need to update these when in fullscreen/maximized?
124 window->set_hit_test_bounds_override_inner( 124 gfx::Insets inner_insets(resize_inside_bounds_size,
125 gfx::Insets(resize_inside_bounds_size_, resize_inside_bounds_size_, 125 resize_inside_bounds_size,
126 resize_inside_bounds_size_, resize_inside_bounds_size_)); 126 resize_inside_bounds_size,
127 resize_inside_bounds_size);
128 window->SetHitTestBoundsOverrideInner(inner_insets, inner_insets);
127 #endif 129 #endif
128 } 130 }
129 131
130 // views::NonClientFrameView implementation. 132 // views::NonClientFrameView implementation.
131 133
132 gfx::Rect ShellWindowFrameView::GetBoundsForClientView() const { 134 gfx::Rect ShellWindowFrameView::GetBoundsForClientView() const {
133 if (window_->IsFrameless() || frame_->IsFullscreen()) 135 if (window_->IsFrameless() || frame_->IsFullscreen())
134 return bounds(); 136 return bounds();
135 return gfx::Rect(0, kCaptionHeight, width(), 137 return gfx::Rect(0, kCaptionHeight, width(),
136 std::max(0, height() - kCaptionHeight)); 138 std::max(0, height() - kCaptionHeight));
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 frame_->Close(); 354 frame_->Close();
353 else if (sender == maximize_button_) 355 else if (sender == maximize_button_)
354 frame_->Maximize(); 356 frame_->Maximize();
355 else if (sender == restore_button_) 357 else if (sender == restore_button_)
356 frame_->Restore(); 358 frame_->Restore();
357 else if (sender == minimize_button_) 359 else if (sender == minimize_button_)
358 frame_->Minimize(); 360 frame_->Minimize();
359 } 361 }
360 362
361 } // namespace apps 363 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | ash/ash_switches.h » ('j') | ui/aura/window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698