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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 | 270 |
271 void InfoBarView::PaintChildren(const ui::PaintContext& context) { | 271 void InfoBarView::PaintChildren(const ui::PaintContext& context) { |
272 // TODO(scr): This really should be the |fill_path_|, but the clipPath seems | 272 // TODO(scr): This really should be the |fill_path_|, but the clipPath seems |
273 // broken on non-Windows platforms (crbug.com/75154). For now, just clip to | 273 // broken on non-Windows platforms (crbug.com/75154). For now, just clip to |
274 // the bar bounds. | 274 // the bar bounds. |
275 // | 275 // |
276 // canvas->sk_canvas()->clipPath(fill_path_); | 276 // canvas->sk_canvas()->clipPath(fill_path_); |
277 DCHECK_EQ(total_height(), height()) | 277 DCHECK_EQ(total_height(), height()) |
278 << "Infobar piecewise heights do not match overall height"; | 278 << "Infobar piecewise heights do not match overall height"; |
279 ui::ClipRecorder clip_recorder(context); | 279 ui::ClipRecorder clip_recorder(context, size()); |
280 clip_recorder.ClipRect(gfx::Rect(0, arrow_height(), width(), bar_height())); | 280 clip_recorder.ClipRect(gfx::Rect(0, arrow_height(), width(), bar_height())); |
281 views::View::PaintChildren(context); | 281 views::View::PaintChildren(context); |
282 } | 282 } |
283 | 283 |
284 void InfoBarView::ButtonPressed(views::Button* sender, | 284 void InfoBarView::ButtonPressed(views::Button* sender, |
285 const ui::Event& event) { | 285 const ui::Event& event) { |
286 if (!owner()) | 286 if (!owner()) |
287 return; // We're closing; don't call anything, it might access the owner. | 287 return; // We're closing; don't call anything, it might access the owner. |
288 if (sender == close_button_) { | 288 if (sender == close_button_) { |
289 delegate()->InfoBarDismissed(); | 289 delegate()->InfoBarDismissed(); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { | 404 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { |
405 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); | 405 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); |
406 | 406 |
407 // This will trigger some screen readers to read the entire contents of this | 407 // This will trigger some screen readers to read the entire contents of this |
408 // infobar. | 408 // infobar. |
409 if (focused_before && focused_now && !Contains(focused_before) && | 409 if (focused_before && focused_now && !Contains(focused_before) && |
410 Contains(focused_now)) { | 410 Contains(focused_now)) { |
411 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 411 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
412 } | 412 } |
413 } | 413 } |
OLD | NEW |