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(InfoBarService* owner, InfoBarDelegate* delegate) | 59 InfoBarView::InfoBarView(InfoBarService* 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( | 64 set_background(new InfoBarBackground(delegate->GetInfoBarType())); |
65 GetInfoBarTopColor(delegate->GetInfoBarType()), | |
66 GetInfoBarBottomColor(delegate->GetInfoBarType()))); | |
67 } | 65 } |
68 | 66 |
69 InfoBarView::~InfoBarView() { | 67 InfoBarView::~InfoBarView() { |
70 // We should have closed any open menus in PlatformSpecificHide(), then | 68 // We should have closed any open menus in PlatformSpecificHide(), then |
71 // subclasses' RunMenu() functions should have prevented opening any new ones | 69 // subclasses' RunMenu() functions should have prevented opening any new ones |
72 // once we became unowned. | 70 // once we became unowned. |
73 DCHECK(!menu_runner_.get()); | 71 DCHECK(!menu_runner_.get()); |
74 } | 72 } |
75 | 73 |
76 views::Label* InfoBarView::CreateLabel(const string16& text) const { | 74 views::Label* InfoBarView::CreateLabel(const string16& text) const { |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 // This will trigger some screen readers to read the entire contents of this | 379 // This will trigger some screen readers to read the entire contents of this |
382 // infobar. | 380 // infobar. |
383 if (focused_before && focused_now && !Contains(focused_before) && | 381 if (focused_before && focused_now && !Contains(focused_before) && |
384 Contains(focused_now)) { | 382 Contains(focused_now)) { |
385 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_ALERT, true); | 383 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_ALERT, true); |
386 } | 384 } |
387 } | 385 } |
388 | 386 |
389 void InfoBarView::OnDidChangeFocus(View* focused_before, View* focused_now) { | 387 void InfoBarView::OnDidChangeFocus(View* focused_before, View* focused_now) { |
390 } | 388 } |
OLD | NEW |