OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "chrome/browser/tab_contents/infobar_delegate.h" | 9 #include "chrome/browser/tab_contents/infobar_delegate.h" |
10 #include "chrome/browser/ui/views/infobars/infobar_background.h" | 10 #include "chrome/browser/ui/views/infobars/infobar_background.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 close_button_->SetImage(views::CustomButton::BS_HOT, | 223 close_button_->SetImage(views::CustomButton::BS_HOT, |
224 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); | 224 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); |
225 close_button_->SetImage(views::CustomButton::BS_PUSHED, | 225 close_button_->SetImage(views::CustomButton::BS_PUSHED, |
226 rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); | 226 rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); |
227 close_button_->SetAccessibleName( | 227 close_button_->SetAccessibleName( |
228 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); | 228 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); |
229 close_button_->set_focusable(true); | 229 close_button_->set_focusable(true); |
230 AddChildView(close_button_); | 230 AddChildView(close_button_); |
231 } else if ((close_button_ != NULL) && (parent == this) && | 231 } else if ((close_button_ != NULL) && (parent == this) && |
232 (child != close_button_) && (close_button_->parent() == this) && | 232 (child != close_button_) && (close_button_->parent() == this) && |
233 (GetChildViewAt(child_count() - 1) != close_button_)) { | 233 (child_at(child_count() - 1) != close_button_)) { |
234 // For accessibility, ensure the close button is the last child view. | 234 // For accessibility, ensure the close button is the last child view. |
235 RemoveChildView(close_button_); | 235 RemoveChildView(close_button_); |
236 AddChildView(close_button_); | 236 AddChildView(close_button_); |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 void InfoBarView::PaintChildren(gfx::Canvas* canvas) { | 240 void InfoBarView::PaintChildren(gfx::Canvas* canvas) { |
241 canvas->Save(); | 241 canvas->Save(); |
242 | 242 |
243 // TODO(scr): This really should be the |fill_path_|, but the clipPath seems | 243 // TODO(scr): This really should be the |fill_path_|, but the clipPath seems |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 343 |
344 void InfoBarView::FocusWillChange(View* focused_before, View* focused_now) { | 344 void InfoBarView::FocusWillChange(View* focused_before, View* focused_now) { |
345 // This will trigger some screen readers to read the entire contents of this | 345 // This will trigger some screen readers to read the entire contents of this |
346 // infobar. | 346 // infobar. |
347 if (focused_before && focused_now && !Contains(focused_before) && | 347 if (focused_before && focused_now && !Contains(focused_before) && |
348 Contains(focused_now) && GetWidget()) { | 348 Contains(focused_now) && GetWidget()) { |
349 GetWidget()->NotifyAccessibilityEvent( | 349 GetWidget()->NotifyAccessibilityEvent( |
350 this, ui::AccessibilityTypes::EVENT_ALERT, true); | 350 this, ui::AccessibilityTypes::EVENT_ALERT, true); |
351 } | 351 } |
352 } | 352 } |
OLD | NEW |