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

Side by Side Diff: chrome/browser/ui/views/infobars/infobar_view.cc

Issue 1423653005: Further plumb visual rect into cc:DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: De-static const rect in test. Created 5 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
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 "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
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::ClipTransformRecorder clip_transform_recorder(context); 279 ui::ClipTransformRecorder clip_transform_recorder(context, size());
280 clip_transform_recorder.ClipRect( 280 clip_transform_recorder.ClipRect(
281 gfx::Rect(0, arrow_height(), width(), bar_height())); 281 gfx::Rect(0, arrow_height(), width(), bar_height()));
282 views::View::PaintChildren(context); 282 views::View::PaintChildren(context);
283 } 283 }
284 284
285 void InfoBarView::ButtonPressed(views::Button* sender, 285 void InfoBarView::ButtonPressed(views::Button* sender,
286 const ui::Event& event) { 286 const ui::Event& event) {
287 if (!owner()) 287 if (!owner())
288 return; // We're closing; don't call anything, it might access the owner. 288 return; // We're closing; don't call anything, it might access the owner.
289 if (sender == close_button_) { 289 if (sender == close_button_) {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { 405 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) {
406 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); 406 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now);
407 407
408 // This will trigger some screen readers to read the entire contents of this 408 // This will trigger some screen readers to read the entire contents of this
409 // infobar. 409 // infobar.
410 if (focused_before && focused_now && !Contains(focused_before) && 410 if (focused_before && focused_now && !Contains(focused_before) &&
411 Contains(focused_now)) { 411 Contains(focused_now)) {
412 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 412 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
413 } 413 }
414 } 414 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698