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

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

Issue 32463003: Modify hit test masks for tabs and tab close buttons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/view.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 <map> 5 #include <map>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 explicit HitTestView(bool has_hittest_mask) 929 explicit HitTestView(bool has_hittest_mask)
930 : has_hittest_mask_(has_hittest_mask) { 930 : has_hittest_mask_(has_hittest_mask) {
931 } 931 }
932 virtual ~HitTestView() {} 932 virtual ~HitTestView() {}
933 933
934 protected: 934 protected:
935 // Overridden from View: 935 // Overridden from View:
936 virtual bool HasHitTestMask() const OVERRIDE { 936 virtual bool HasHitTestMask() const OVERRIDE {
937 return has_hittest_mask_; 937 return has_hittest_mask_;
938 } 938 }
939 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE { 939 virtual void GetHitTestMask(HitTestSource source,
940 gfx::Path* mask) const OVERRIDE {
940 DCHECK(has_hittest_mask_); 941 DCHECK(has_hittest_mask_);
941 DCHECK(mask); 942 DCHECK(mask);
942 943
943 SkScalar w = SkIntToScalar(width()); 944 SkScalar w = SkIntToScalar(width());
944 SkScalar h = SkIntToScalar(height()); 945 SkScalar h = SkIntToScalar(height());
945 946
946 // Create a triangular mask within the bounds of this View. 947 // Create a triangular mask within the bounds of this View.
947 mask->moveTo(w / 2, 0); 948 mask->moveTo(w / 2, 0);
948 mask->lineTo(w, h); 949 mask->lineTo(w, h);
949 mask->lineTo(0, h); 950 mask->lineTo(0, h);
(...skipping 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after
3194 const std::vector<ui::Layer*>& child_layers_post = root_layer->children(); 3195 const std::vector<ui::Layer*>& child_layers_post = root_layer->children();
3195 ASSERT_EQ(3u, child_layers_post.size()); 3196 ASSERT_EQ(3u, child_layers_post.size());
3196 EXPECT_EQ(v1->layer(), child_layers_post[0]); 3197 EXPECT_EQ(v1->layer(), child_layers_post[0]);
3197 EXPECT_EQ(v2->layer(), child_layers_post[1]); 3198 EXPECT_EQ(v2->layer(), child_layers_post[1]);
3198 EXPECT_EQ(v1_old_layer, child_layers_post[2]); 3199 EXPECT_EQ(v1_old_layer, child_layers_post[2]);
3199 } 3200 }
3200 3201
3201 #endif // USE_AURA 3202 #endif // USE_AURA
3202 3203
3203 } // namespace views 3204 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698