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

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

Issue 2705763002: InfoBarContainerView: Redraws infobars on a native theme change (Closed)
Patch Set: Address pkasting@'s comments Created 3 years, 10 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
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_container_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_container_view.h" 5 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
6 6
7 #include "cc/paint/paint_flags.h" 7 #include "cc/paint/paint_flags.h"
8 #include "cc/paint/paint_shader.h" 8 #include "cc/paint/paint_shader.h"
9 #include "chrome/browser/ui/infobar_container_delegate.h" 9 #include "chrome/browser/ui/infobar_container_delegate.h"
10 #include "chrome/browser/ui/view_ids.h" 10 #include "chrome/browser/ui/view_ids.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 content_shadow_->SetBounds(0, top, width(), kLargeShadowHeight); 117 content_shadow_->SetBounds(0, top, width(), kLargeShadowHeight);
118 } 118 }
119 119
120 void InfoBarContainerView::GetAccessibleNodeData(ui::AXNodeData* node_data) { 120 void InfoBarContainerView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
121 node_data->role = ui::AX_ROLE_GROUP; 121 node_data->role = ui::AX_ROLE_GROUP;
122 node_data->SetName(l10n_util::GetStringUTF8(IDS_ACCNAME_INFOBAR_CONTAINER)); 122 node_data->SetName(l10n_util::GetStringUTF8(IDS_ACCNAME_INFOBAR_CONTAINER));
123 } 123 }
124 124
125 void InfoBarContainerView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
126 // Infobars must be redrawn when the NativeTheme changes because
127 // they have a border with color COLOR_TOOLBAR_BOTTOM_SEPARATOR,
128 // which might have changed.
129 for (int i = 0; i < child_count(); ++i)
130 child_at(i)->SchedulePaint();
131 }
132
125 void InfoBarContainerView::PlatformSpecificAddInfoBar( 133 void InfoBarContainerView::PlatformSpecificAddInfoBar(
126 infobars::InfoBar* infobar, 134 infobars::InfoBar* infobar,
127 size_t position) { 135 size_t position) {
128 AddChildViewAt(static_cast<InfoBarView*>(infobar), 136 AddChildViewAt(static_cast<InfoBarView*>(infobar),
129 static_cast<int>(position)); 137 static_cast<int>(position));
130 } 138 }
131 139
132 void InfoBarContainerView::PlatformSpecificRemoveInfoBar( 140 void InfoBarContainerView::PlatformSpecificRemoveInfoBar(
133 infobars::InfoBar* infobar) { 141 infobars::InfoBar* infobar) {
134 RemoveChildView(static_cast<InfoBarView*>(infobar)); 142 RemoveChildView(static_cast<InfoBarView*>(infobar));
135 } 143 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_container_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698