OLD | NEW |
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/app_list/app_list_view.h" | 5 #include "ui/app_list/app_list_view.h" |
6 | 6 |
7 #include "ui/app_list/app_list_bubble_border.h" | 7 #include "ui/app_list/app_list_bubble_border.h" |
8 #include "ui/app_list/app_list_item_view.h" | 8 #include "ui/app_list/app_list_item_view.h" |
9 #include "ui/app_list/app_list_model.h" | 9 #include "ui/app_list/app_list_model.h" |
10 #include "ui/app_list/app_list_view_delegate.h" | 10 #include "ui/app_list/app_list_view_delegate.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 set_anchor_view(anchor); | 68 set_anchor_view(anchor); |
69 set_margins(gfx::Insets()); | 69 set_margins(gfx::Insets()); |
70 set_move_with_anchor(true); | 70 set_move_with_anchor(true); |
71 set_parent_window(parent); | 71 set_parent_window(parent); |
72 set_close_on_deactivate(false); | 72 set_close_on_deactivate(false); |
73 set_anchor_insets(gfx::Insets(kArrowOffset, kArrowOffset, kArrowOffset, | 73 set_anchor_insets(gfx::Insets(kArrowOffset, kArrowOffset, kArrowOffset, |
74 kArrowOffset)); | 74 kArrowOffset)); |
75 views::BubbleDelegateView::CreateBubble(this); | 75 views::BubbleDelegateView::CreateBubble(this); |
76 | 76 |
77 // Resets default background since AppListBubbleBorder paints background. | |
78 GetBubbleFrameView()->set_background(NULL); | |
79 | |
80 // Overrides border with AppListBubbleBorder. | 77 // Overrides border with AppListBubbleBorder. |
81 bubble_border_ = new AppListBubbleBorder(this, search_box_view_); | 78 bubble_border_ = new AppListBubbleBorder(this, search_box_view_); |
82 GetBubbleFrameView()->SetBubbleBorder(bubble_border_); | 79 GetBubbleFrameView()->SetBubbleBorder(bubble_border_); |
83 SetBubbleArrowLocation(arrow_location); | 80 SetBubbleArrowLocation(arrow_location); |
84 | 81 |
| 82 // Resets default background since AppListBubbleBorder paints background. |
| 83 GetBubbleFrameView()->set_background(NULL); |
| 84 |
85 CreateModel(); | 85 CreateModel(); |
86 } | 86 } |
87 | 87 |
88 void AppListView::SetBubbleArrowLocation( | 88 void AppListView::SetBubbleArrowLocation( |
89 views::BubbleBorder::ArrowLocation arrow_location) { | 89 views::BubbleBorder::ArrowLocation arrow_location) { |
90 DCHECK(bubble_border_); | 90 DCHECK(bubble_border_); |
91 bubble_border_->set_arrow_location(arrow_location); | 91 bubble_border_->set_arrow_location(arrow_location); |
92 SizeToContents(); // Recalcuates with new border. | 92 SizeToContents(); // Recalcuates with new border. |
93 } | 93 } |
94 | 94 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 void AppListView::OpenResult(const SearchResult& result, int event_flags) { | 188 void AppListView::OpenResult(const SearchResult& result, int event_flags) { |
189 if (delegate_.get()) | 189 if (delegate_.get()) |
190 delegate_->OpenSearchResult(result, event_flags); | 190 delegate_->OpenSearchResult(result, event_flags); |
191 Close(); | 191 Close(); |
192 } | 192 } |
193 | 193 |
194 } // namespace app_list | 194 } // namespace app_list |
OLD | NEW |