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/bar_control_button.h" | 14 #include "chrome/browser/ui/views/bar_control_button.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" |
17 #include "components/infobars/core/infobar_delegate.h" | 18 #include "components/infobars/core/infobar_delegate.h" |
18 #include "grit/components_strings.h" | 19 #include "components/strings/grit/components_strings.h" |
19 #include "grit/theme_resources.h" | |
20 #include "third_party/skia/include/effects/SkGradientShader.h" | 20 #include "third_party/skia/include/effects/SkGradientShader.h" |
21 #include "ui/accessibility/ax_view_state.h" | 21 #include "ui/accessibility/ax_view_state.h" |
22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/base/material_design/material_design_controller.h" | 23 #include "ui/base/material_design/material_design_controller.h" |
24 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
25 #include "ui/gfx/canvas.h" | 25 #include "ui/gfx/canvas.h" |
26 #include "ui/gfx/color_palette.h" | 26 #include "ui/gfx/color_palette.h" |
27 #include "ui/gfx/image/image.h" | 27 #include "ui/gfx/image/image.h" |
28 #include "ui/gfx/paint_vector_icon.h" | 28 #include "ui/gfx/paint_vector_icon.h" |
29 #include "ui/gfx/vector_icons_public.h" | 29 #include "ui/gfx/vector_icons_public.h" |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 } | 427 } |
428 | 428 |
429 bool InfoBarView::DoesIntersectRect(const View* target, | 429 bool InfoBarView::DoesIntersectRect(const View* target, |
430 const gfx::Rect& rect) const { | 430 const gfx::Rect& rect) const { |
431 DCHECK_EQ(this, target); | 431 DCHECK_EQ(this, target); |
432 // Only events that intersect the portion below the arrow are interesting. | 432 // Only events that intersect the portion below the arrow are interesting. |
433 gfx::Rect non_arrow_bounds = GetLocalBounds(); | 433 gfx::Rect non_arrow_bounds = GetLocalBounds(); |
434 non_arrow_bounds.Inset(0, arrow_height(), 0, 0); | 434 non_arrow_bounds.Inset(0, arrow_height(), 0, 0); |
435 return rect.Intersects(non_arrow_bounds); | 435 return rect.Intersects(non_arrow_bounds); |
436 } | 436 } |
OLD | NEW |