| 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 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 263 } |
| 264 | 264 |
| 265 void InfoBarView::PaintChildren(const ui::PaintContext& context) { | 265 void InfoBarView::PaintChildren(const ui::PaintContext& context) { |
| 266 // TODO(scr): This really should be the |fill_path_|, but the clipPath seems | 266 // TODO(scr): This really should be the |fill_path_|, but the clipPath seems |
| 267 // broken on non-Windows platforms (crbug.com/75154). For now, just clip to | 267 // broken on non-Windows platforms (crbug.com/75154). For now, just clip to |
| 268 // the bar bounds. | 268 // the bar bounds. |
| 269 // | 269 // |
| 270 // canvas->sk_canvas()->clipPath(fill_path_); | 270 // canvas->sk_canvas()->clipPath(fill_path_); |
| 271 DCHECK_EQ(total_height(), height()) | 271 DCHECK_EQ(total_height(), height()) |
| 272 << "Infobar piecewise heights do not match overall height"; | 272 << "Infobar piecewise heights do not match overall height"; |
| 273 ui::ClipTransformRecorder clip_transform_recorder(context); | 273 ui::ClipTransformRecorder clip_transform_recorder(context, size()); |
| 274 clip_transform_recorder.ClipRect( | 274 clip_transform_recorder.ClipRect( |
| 275 gfx::Rect(0, arrow_height(), width(), bar_height())); | 275 gfx::Rect(0, arrow_height(), width(), bar_height())); |
| 276 views::View::PaintChildren(context); | 276 views::View::PaintChildren(context); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void InfoBarView::ButtonPressed(views::Button* sender, | 279 void InfoBarView::ButtonPressed(views::Button* sender, |
| 280 const ui::Event& event) { | 280 const ui::Event& event) { |
| 281 if (!owner()) | 281 if (!owner()) |
| 282 return; // We're closing; don't call anything, it might access the owner. | 282 return; // We're closing; don't call anything, it might access the owner. |
| 283 if (sender == close_button_) { | 283 if (sender == close_button_) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { | 399 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { |
| 400 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); | 400 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); |
| 401 | 401 |
| 402 // This will trigger some screen readers to read the entire contents of this | 402 // This will trigger some screen readers to read the entire contents of this |
| 403 // infobar. | 403 // infobar. |
| 404 if (focused_before && focused_now && !Contains(focused_before) && | 404 if (focused_before && focused_now && !Contains(focused_before) && |
| 405 Contains(focused_now)) { | 405 Contains(focused_now)) { |
| 406 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 406 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 407 } | 407 } |
| 408 } | 408 } |
| OLD | NEW |