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

Side by Side Diff: ui/views/bubble/bubble_delegate.cc

Issue 1837093003: NOSUBMIT: Demonstrate accelerated layer painting problem in mus/mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « mash/wm/window_manager.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | 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) 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 "ui/views/bubble/bubble_delegate.h" 5 #include "ui/views/bubble/bubble_delegate.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "ui/accessibility/ax_view_state.h" 8 #include "ui/accessibility/ax_view_state.h"
9 #include "ui/base/default_style.h" 9 #include "ui/base/default_style.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 302
303 const gfx::FontList& BubbleDelegateView::GetTitleFontList() const { 303 const gfx::FontList& BubbleDelegateView::GetTitleFontList() const {
304 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 304 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
305 return rb.GetFontListWithDelta(ui::kTitleFontSizeDelta); 305 return rb.GetFontListWithDelta(ui::kTitleFontSizeDelta);
306 } 306 }
307 307
308 void BubbleDelegateView::UpdateColorsFromTheme(const ui::NativeTheme* theme) { 308 void BubbleDelegateView::UpdateColorsFromTheme(const ui::NativeTheme* theme) {
309 if (!color_explicitly_set_) 309 if (!color_explicitly_set_)
310 color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_BubbleBackground); 310 color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_BubbleBackground);
311 // JAMES: When the individual views on top aren't drawing, this is more
312 // obvious than off-white.
313 color_ = SK_ColorRED;
311 set_background(Background::CreateSolidBackground(color())); 314 set_background(Background::CreateSolidBackground(color()));
312 BubbleFrameView* frame_view = GetBubbleFrameView(); 315 BubbleFrameView* frame_view = GetBubbleFrameView();
313 if (frame_view) 316 if (frame_view)
314 frame_view->bubble_border()->set_background_color(color()); 317 frame_view->bubble_border()->set_background_color(color());
315 } 318 }
316 319
317 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) { 320 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) {
318 if (widget == GetWidget() && anchor_widget() && 321 if (widget == GetWidget() && anchor_widget() &&
319 anchor_widget()->GetTopLevelWidget()) { 322 anchor_widget()->GetTopLevelWidget()) {
320 anchor_widget()->GetTopLevelWidget()->SetAlwaysRenderAsActive(visible); 323 anchor_widget()->GetTopLevelWidget()->SetAlwaysRenderAsActive(visible);
321 } 324 }
322 325
323 // Fire AX_EVENT_ALERT for bubbles marked as AX_ROLE_ALERT_DIALOG; this 326 // Fire AX_EVENT_ALERT for bubbles marked as AX_ROLE_ALERT_DIALOG; this
324 // instructs accessibility tools to read the bubble in its entirety rather 327 // instructs accessibility tools to read the bubble in its entirety rather
325 // than just its title and initially focused view. See 328 // than just its title and initially focused view. See
326 // http://crbug.com/474622 for details. 329 // http://crbug.com/474622 for details.
327 if (widget == GetWidget() && visible) { 330 if (widget == GetWidget() && visible) {
328 ui::AXViewState state; 331 ui::AXViewState state;
329 GetAccessibleState(&state); 332 GetAccessibleState(&state);
330 if (state.role == ui::AX_ROLE_ALERT_DIALOG) 333 if (state.role == ui::AX_ROLE_ALERT_DIALOG)
331 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 334 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
332 } 335 }
333 } 336 }
334 337
335 } // namespace views 338 } // namespace views
OLDNEW
« no previous file with comments | « mash/wm/window_manager.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698