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

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

Issue 309713002: Fix bg color of bookmark bubble view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: also give bubbles the correct bg color Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc ('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) 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 "ui/accessibility/ax_view_state.h" 7 #include "ui/accessibility/ax_view_state.h"
8 #include "ui/gfx/color_utils.h" 8 #include "ui/gfx/color_utils.h"
9 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
10 #include "ui/native_theme/native_theme.h" 10 #include "ui/native_theme/native_theme.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 gfx::Rect BubbleDelegateView::GetBubbleBounds() { 272 gfx::Rect BubbleDelegateView::GetBubbleBounds() {
273 // The argument rect has its origin at the bubble's arrow anchor point; 273 // The argument rect has its origin at the bubble's arrow anchor point;
274 // its size is the preferred size of the bubble's client view (this view). 274 // its size is the preferred size of the bubble's client view (this view).
275 return GetBubbleFrameView()->GetUpdatedWindowBounds(GetAnchorRect(), 275 return GetBubbleFrameView()->GetUpdatedWindowBounds(GetAnchorRect(),
276 GetPreferredSize(), adjust_if_offscreen_); 276 GetPreferredSize(), adjust_if_offscreen_);
277 } 277 }
278 278
279 void BubbleDelegateView::UpdateColorsFromTheme(const ui::NativeTheme* theme) { 279 void BubbleDelegateView::UpdateColorsFromTheme(const ui::NativeTheme* theme) {
280 if (!color_explicitly_set_) 280 if (!color_explicitly_set_)
281 color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_WindowBackground); 281 color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground);
282 set_background(Background::CreateSolidBackground(color())); 282 set_background(Background::CreateSolidBackground(color()));
283 BubbleFrameView* frame_view = GetBubbleFrameView(); 283 BubbleFrameView* frame_view = GetBubbleFrameView();
284 if (frame_view) 284 if (frame_view)
285 frame_view->bubble_border()->set_background_color(color()); 285 frame_view->bubble_border()->set_background_color(color());
286 } 286 }
287 287
288 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) { 288 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) {
289 if (widget == GetWidget() && anchor_widget() && 289 if (widget == GetWidget() && anchor_widget() &&
290 anchor_widget()->GetTopLevelWidget()) { 290 anchor_widget()->GetTopLevelWidget()) {
291 if (visible) 291 if (visible)
292 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); 292 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering();
293 else 293 else
294 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); 294 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering();
295 } 295 }
296 } 296 }
297 297
298 } // namespace views 298 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698