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

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

Issue 657333002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 const int kHoveredImageSet[] = IMAGE_GRID(IDR_INFOBARBUTTON_HOVER); 119 const int kHoveredImageSet[] = IMAGE_GRID(IDR_INFOBARBUTTON_HOVER);
120 label_button_border->SetPainter( 120 label_button_border->SetPainter(
121 false, views::Button::STATE_HOVERED, 121 false, views::Button::STATE_HOVERED,
122 views::Painter::CreateImageGridPainter(kHoveredImageSet)); 122 views::Painter::CreateImageGridPainter(kHoveredImageSet));
123 const int kPressedImageSet[] = IMAGE_GRID(IDR_INFOBARBUTTON_PRESSED); 123 const int kPressedImageSet[] = IMAGE_GRID(IDR_INFOBARBUTTON_PRESSED);
124 label_button_border->SetPainter( 124 label_button_border->SetPainter(
125 false, views::Button::STATE_PRESSED, 125 false, views::Button::STATE_PRESSED,
126 views::Painter::CreateImageGridPainter(kPressedImageSet)); 126 views::Painter::CreateImageGridPainter(kPressedImageSet));
127 127
128 views::LabelButton* label_button = new views::LabelButton(listener, text); 128 views::LabelButton* label_button = new views::LabelButton(listener, text);
129 label_button->SetBorder(label_button_border.PassAs<views::Border>()); 129 label_button->SetBorder(label_button_border.Pass());
130 label_button->set_animate_on_state_change(false); 130 label_button->set_animate_on_state_change(false);
131 label_button->SetTextColor(views::Button::STATE_NORMAL, SK_ColorBLACK); 131 label_button->SetTextColor(views::Button::STATE_NORMAL, SK_ColorBLACK);
132 label_button->SetTextColor(views::Button::STATE_HOVERED, SK_ColorBLACK); 132 label_button->SetTextColor(views::Button::STATE_HOVERED, SK_ColorBLACK);
133 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 133 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
134 label_button->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont)); 134 label_button->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont));
135 label_button->SizeToPreferredSize(); 135 label_button->SizeToPreferredSize();
136 label_button->SetFocusable(true); 136 label_button->SetFocusable(true);
137 return label_button; 137 return label_button;
138 } 138 }
139 139
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { 386 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) {
387 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); 387 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now);
388 388
389 // This will trigger some screen readers to read the entire contents of this 389 // This will trigger some screen readers to read the entire contents of this
390 // infobar. 390 // infobar.
391 if (focused_before && focused_now && !Contains(focused_before) && 391 if (focused_before && focused_now && !Contains(focused_before) &&
392 Contains(focused_now)) { 392 Contains(focused_now)) {
393 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 393 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
394 } 394 }
395 } 395 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/extension_infobar.cc ('k') | chrome/browser/ui/views/location_bar/origin_chip_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698