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

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

Issue 863173004: More class names for views class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 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 | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/widget/widget.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/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/color_utils.h" 9 #include "ui/gfx/color_utils.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 27 matching lines...) Expand all
38 bubble_params.parent = bubble->anchor_widget()->GetNativeView(); 38 bubble_params.parent = bubble->anchor_widget()->GetNativeView();
39 bubble_params.activatable = bubble->CanActivate() ? 39 bubble_params.activatable = bubble->CanActivate() ?
40 Widget::InitParams::ACTIVATABLE_YES : Widget::InitParams::ACTIVATABLE_NO; 40 Widget::InitParams::ACTIVATABLE_YES : Widget::InitParams::ACTIVATABLE_NO;
41 bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget); 41 bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget);
42 bubble_widget->Init(bubble_params); 42 bubble_widget->Init(bubble_params);
43 return bubble_widget; 43 return bubble_widget;
44 } 44 }
45 45
46 } // namespace 46 } // namespace
47 47
48 // static
49 const char BubbleDelegateView::kViewClassName[] = "BubbleDelegateView";
50
48 BubbleDelegateView::BubbleDelegateView() 51 BubbleDelegateView::BubbleDelegateView()
49 : close_on_esc_(true), 52 : close_on_esc_(true),
50 close_on_deactivate_(true), 53 close_on_deactivate_(true),
51 anchor_view_storage_id_(ViewStorage::GetInstance()->CreateStorageID()), 54 anchor_view_storage_id_(ViewStorage::GetInstance()->CreateStorageID()),
52 anchor_widget_(NULL), 55 anchor_widget_(NULL),
53 arrow_(BubbleBorder::TOP_LEFT), 56 arrow_(BubbleBorder::TOP_LEFT),
54 shadow_(BubbleBorder::SMALL_SHADOW), 57 shadow_(BubbleBorder::SMALL_SHADOW),
55 color_explicitly_set_(false), 58 color_explicitly_set_(false),
56 margins_(kDefaultMargin, kDefaultMargin, kDefaultMargin, kDefaultMargin), 59 margins_(kDefaultMargin, kDefaultMargin, kDefaultMargin, kDefaultMargin),
57 accept_events_(true), 60 accept_events_(true),
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow); 137 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow);
135 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>( 138 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>(
136 new BubbleBorder(adjusted_arrow, shadow(), color()))); 139 new BubbleBorder(adjusted_arrow, shadow(), color())));
137 return frame; 140 return frame;
138 } 141 }
139 142
140 void BubbleDelegateView::GetAccessibleState(ui::AXViewState* state) { 143 void BubbleDelegateView::GetAccessibleState(ui::AXViewState* state) {
141 state->role = ui::AX_ROLE_DIALOG; 144 state->role = ui::AX_ROLE_DIALOG;
142 } 145 }
143 146
147 const char* BubbleDelegateView::GetClassName() const {
148 return kViewClassName;
149 }
150
144 void BubbleDelegateView::OnWidgetDestroying(Widget* widget) { 151 void BubbleDelegateView::OnWidgetDestroying(Widget* widget) {
145 if (anchor_widget() == widget) 152 if (anchor_widget() == widget)
146 SetAnchorView(NULL); 153 SetAnchorView(NULL);
147 } 154 }
148 155
149 void BubbleDelegateView::OnWidgetVisibilityChanging(Widget* widget, 156 void BubbleDelegateView::OnWidgetVisibilityChanging(Widget* widget,
150 bool visible) { 157 bool visible) {
151 #if defined(OS_WIN) 158 #if defined(OS_WIN)
152 // On Windows we need to handle this before the bubble is visible or hidden. 159 // On Windows we need to handle this before the bubble is visible or hidden.
153 // Please see the comment on the OnWidgetVisibilityChanging function. On 160 // Please see the comment on the OnWidgetVisibilityChanging function. On
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 if (widget == GetWidget() && anchor_widget() && 301 if (widget == GetWidget() && anchor_widget() &&
295 anchor_widget()->GetTopLevelWidget()) { 302 anchor_widget()->GetTopLevelWidget()) {
296 if (visible) 303 if (visible)
297 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); 304 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering();
298 else 305 else
299 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); 306 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering();
300 } 307 }
301 } 308 }
302 309
303 } // namespace views 310 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698