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

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

Issue 12634025: Inconsistent use of [x] close panel icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_173251
Patch Set: Fixed compile on linux, mac and win Created 7 years, 9 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 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #endif 9 #endif
10 10
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 gfx::Image* image = delegate()->GetIcon(); 220 gfx::Image* image = delegate()->GetIcon();
221 if (image) { 221 if (image) {
222 icon_ = new views::ImageView; 222 icon_ = new views::ImageView;
223 icon_->SetImage(image->ToImageSkia()); 223 icon_->SetImage(image->ToImageSkia());
224 AddChildView(icon_); 224 AddChildView(icon_);
225 } 225 }
226 226
227 close_button_ = new views::ImageButton(this); 227 close_button_ = new views::ImageButton(this);
228 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 228 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
229 close_button_->SetImage(views::CustomButton::STATE_NORMAL, 229 close_button_->SetImage(views::CustomButton::STATE_NORMAL,
230 rb.GetImageNamed(IDR_CLOSE_BAR).ToImageSkia()); 230 rb.GetImageNamed(IDR_CLOSE_1).ToImageSkia());
231 close_button_->SetImage(views::CustomButton::STATE_HOVERED, 231 close_button_->SetImage(views::CustomButton::STATE_HOVERED,
232 rb.GetImageNamed(IDR_CLOSE_BAR_H).ToImageSkia()); 232 rb.GetImageNamed(IDR_CLOSE_1_H).ToImageSkia());
233 close_button_->SetImage(views::CustomButton::STATE_PRESSED, 233 close_button_->SetImage(views::CustomButton::STATE_PRESSED,
234 rb.GetImageNamed(IDR_CLOSE_BAR_P).ToImageSkia()); 234 rb.GetImageNamed(IDR_CLOSE_1_P).ToImageSkia());
235 close_button_->SetAccessibleName( 235 close_button_->SetAccessibleName(
236 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); 236 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
237 close_button_->set_focusable(true); 237 close_button_->set_focusable(true);
238 AddChildView(close_button_); 238 AddChildView(close_button_);
239 } else if ((close_button_ != NULL) && (parent == this) && 239 } else if ((close_button_ != NULL) && (parent == this) &&
240 (child != close_button_) && (close_button_->parent() == this) && 240 (child != close_button_) && (close_button_->parent() == this) &&
241 (child_at(child_count() - 1) != close_button_)) { 241 (child_at(child_count() - 1) != close_button_)) {
242 // For accessibility, ensure the close button is the last child view. 242 // For accessibility, ensure the close button is the last child view.
243 RemoveChildView(close_button_); 243 RemoveChildView(close_button_);
244 AddChildView(close_button_); 244 AddChildView(close_button_);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // infobar. 386 // infobar.
387 if (focused_before && focused_now && !Contains(focused_before) && 387 if (focused_before && focused_now && !Contains(focused_before) &&
388 Contains(focused_now) && GetWidget()) { 388 Contains(focused_now) && GetWidget()) {
389 GetWidget()->NotifyAccessibilityEvent( 389 GetWidget()->NotifyAccessibilityEvent(
390 this, ui::AccessibilityTypes::EVENT_ALERT, true); 390 this, ui::AccessibilityTypes::EVENT_ALERT, true);
391 } 391 }
392 } 392 }
393 393
394 void InfoBarView::OnDidChangeFocus(View* focused_before, View* focused_now) { 394 void InfoBarView::OnDidChangeFocus(View* focused_before, View* focused_now) {
395 } 395 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698