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

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

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « mojo/examples/launcher/launcher.cc ('k') | ui/views/touchui/touch_selection_controller_impl.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 "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 17 matching lines...) Expand all
28 Widget* CreateBubbleWidget(BubbleDelegateView* bubble) { 28 Widget* CreateBubbleWidget(BubbleDelegateView* bubble) {
29 Widget* bubble_widget = new Widget(); 29 Widget* bubble_widget = new Widget();
30 Widget::InitParams bubble_params(Widget::InitParams::TYPE_BUBBLE); 30 Widget::InitParams bubble_params(Widget::InitParams::TYPE_BUBBLE);
31 bubble_params.delegate = bubble; 31 bubble_params.delegate = bubble;
32 bubble_params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW; 32 bubble_params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW;
33 bubble_params.accept_events = bubble->accept_events(); 33 bubble_params.accept_events = bubble->accept_events();
34 if (bubble->parent_window()) 34 if (bubble->parent_window())
35 bubble_params.parent = bubble->parent_window(); 35 bubble_params.parent = bubble->parent_window();
36 else if (bubble->anchor_widget()) 36 else if (bubble->anchor_widget())
37 bubble_params.parent = bubble->anchor_widget()->GetNativeView(); 37 bubble_params.parent = bubble->anchor_widget()->GetNativeView();
38 bubble_params.can_activate = bubble->CanActivate(); 38 bubble_params.activatable = bubble->CanActivate() ?
39 Widget::InitParams::ACTIVATABLE_YES : Widget::InitParams::ACTIVATABLE_NO;
39 bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget); 40 bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget);
40 bubble_widget->Init(bubble_params); 41 bubble_widget->Init(bubble_params);
41 return bubble_widget; 42 return bubble_widget;
42 } 43 }
43 44
44 } // namespace 45 } // namespace
45 46
46 BubbleDelegateView::BubbleDelegateView() 47 BubbleDelegateView::BubbleDelegateView()
47 : close_on_esc_(true), 48 : close_on_esc_(true),
48 close_on_deactivate_(true), 49 close_on_deactivate_(true),
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 if (widget == GetWidget() && anchor_widget() && 289 if (widget == GetWidget() && anchor_widget() &&
289 anchor_widget()->GetTopLevelWidget()) { 290 anchor_widget()->GetTopLevelWidget()) {
290 if (visible) 291 if (visible)
291 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); 292 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering();
292 else 293 else
293 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); 294 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering();
294 } 295 }
295 } 296 }
296 297
297 } // namespace views 298 } // namespace views
OLDNEW
« no previous file with comments | « mojo/examples/launcher/launcher.cc ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698