| 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 const int InfoBarView::kButtonButtonSpacing = 10; | 55 const int InfoBarView::kButtonButtonSpacing = 10; |
| 56 const int InfoBarView::kEndOfLabelSpacing = 16; | 56 const int InfoBarView::kEndOfLabelSpacing = 16; |
| 57 const int InfoBarView::kHorizontalPadding = 6; | 57 const int InfoBarView::kHorizontalPadding = 6; |
| 58 | 58 |
| 59 InfoBarView::InfoBarView(InfoBarTabHelper* owner, InfoBarDelegate* delegate) | 59 InfoBarView::InfoBarView(InfoBarTabHelper* owner, InfoBarDelegate* delegate) |
| 60 : InfoBar(owner, delegate), | 60 : InfoBar(owner, delegate), |
| 61 icon_(NULL), | 61 icon_(NULL), |
| 62 close_button_(NULL) { | 62 close_button_(NULL) { |
| 63 set_owned_by_client(); // InfoBar deletes itself at the appropriate time. | 63 set_owned_by_client(); // InfoBar deletes itself at the appropriate time. |
| 64 set_background(new InfoBarBackground(delegate->GetInfoBarType())); | 64 set_background(new InfoBarBackground( |
| 65 GetInfoBarTopColor(delegate->GetInfoBarType()), |
| 66 GetInfoBarBottomColor(delegate->GetInfoBarType()))); |
| 65 } | 67 } |
| 66 | 68 |
| 67 InfoBarView::~InfoBarView() { | 69 InfoBarView::~InfoBarView() { |
| 68 // We should have closed any open menus in PlatformSpecificHide(), then | 70 // We should have closed any open menus in PlatformSpecificHide(), then |
| 69 // subclasses' RunMenu() functions should have prevented opening any new ones | 71 // subclasses' RunMenu() functions should have prevented opening any new ones |
| 70 // once we became unowned. | 72 // once we became unowned. |
| 71 DCHECK(!menu_runner_.get()); | 73 DCHECK(!menu_runner_.get()); |
| 72 } | 74 } |
| 73 | 75 |
| 74 views::Label* InfoBarView::CreateLabel(const string16& text) const { | 76 views::Label* InfoBarView::CreateLabel(const string16& text) const { |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 // infobar. | 386 // infobar. |
| 385 if (focused_before && focused_now && !Contains(focused_before) && | 387 if (focused_before && focused_now && !Contains(focused_before) && |
| 386 Contains(focused_now) && GetWidget()) { | 388 Contains(focused_now) && GetWidget()) { |
| 387 GetWidget()->NotifyAccessibilityEvent( | 389 GetWidget()->NotifyAccessibilityEvent( |
| 388 this, ui::AccessibilityTypes::EVENT_ALERT, true); | 390 this, ui::AccessibilityTypes::EVENT_ALERT, true); |
| 389 } | 391 } |
| 390 } | 392 } |
| 391 | 393 |
| 392 void InfoBarView::OnDidChangeFocus(View* focused_before, View* focused_now) { | 394 void InfoBarView::OnDidChangeFocus(View* focused_before, View* focused_now) { |
| 393 } | 395 } |
| OLD | NEW |