OLD | NEW |
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 "chrome/browser/ui/views/infobars/infobar_view.h" | 5 #include "chrome/browser/ui/views/infobars/infobar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "chrome/browser/ui/infobar_container_delegate.h" | 13 #include "chrome/browser/ui/infobar_container_delegate.h" |
14 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | 14 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
15 #include "chrome/browser/ui/views/infobars/infobar_background.h" | 15 #include "chrome/browser/ui/views/infobars/infobar_background.h" |
16 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
17 #include "chrome/grit/theme_resources.h" | |
18 #include "components/infobars/core/infobar_delegate.h" | 17 #include "components/infobars/core/infobar_delegate.h" |
19 #include "components/strings/grit/components_strings.h" | 18 #include "components/strings/grit/components_strings.h" |
20 #include "third_party/skia/include/effects/SkGradientShader.h" | 19 #include "third_party/skia/include/effects/SkGradientShader.h" |
21 #include "ui/accessibility/ax_node_data.h" | 20 #include "ui/accessibility/ax_node_data.h" |
22 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
24 #include "ui/gfx/color_palette.h" | 23 #include "ui/gfx/color_palette.h" |
25 #include "ui/gfx/image/image.h" | 24 #include "ui/gfx/image/image.h" |
26 #include "ui/gfx/paint_vector_icon.h" | 25 #include "ui/gfx/paint_vector_icon.h" |
27 #include "ui/native_theme/common_theme.h" | 26 #include "ui/native_theme/common_theme.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 311 } |
313 | 312 |
314 bool InfoBarView::DoesIntersectRect(const View* target, | 313 bool InfoBarView::DoesIntersectRect(const View* target, |
315 const gfx::Rect& rect) const { | 314 const gfx::Rect& rect) const { |
316 DCHECK_EQ(this, target); | 315 DCHECK_EQ(this, target); |
317 // Only events that intersect the portion below the arrow are interesting. | 316 // Only events that intersect the portion below the arrow are interesting. |
318 gfx::Rect non_arrow_bounds = GetLocalBounds(); | 317 gfx::Rect non_arrow_bounds = GetLocalBounds(); |
319 non_arrow_bounds.Inset(0, arrow_height(), 0, 0); | 318 non_arrow_bounds.Inset(0, arrow_height(), 0, 0); |
320 return rect.Intersects(non_arrow_bounds); | 319 return rect.Intersects(non_arrow_bounds); |
321 } | 320 } |
OLD | NEW |