| 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 "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "ui/app_list/app_list_bubble_border.h" | 8 #include "ui/app_list/app_list_bubble_border.h" |
| 9 #include "ui/app_list/app_list_constants.h" | 9 #include "ui/app_list/app_list_constants.h" |
| 10 #include "ui/app_list/app_list_item_view.h" | 10 #include "ui/app_list/app_list_item_view.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 CreateModel(); | 101 CreateModel(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void AppListView::SetBubbleArrowLocation( | 104 void AppListView::SetBubbleArrowLocation( |
| 105 views::BubbleBorder::ArrowLocation arrow_location) { | 105 views::BubbleBorder::ArrowLocation arrow_location) { |
| 106 DCHECK(bubble_border_); | 106 DCHECK(bubble_border_); |
| 107 bubble_border_->set_arrow_location(arrow_location); | 107 bubble_border_->set_arrow_location(arrow_location); |
| 108 SizeToContents(); // Recalcuates with new border. | 108 SizeToContents(); // Recalcuates with new border. |
| 109 } | 109 } |
| 110 | 110 |
| 111 void AppListView::SetAnchorPoint(const gfx::Point& anchor_point) { |
| 112 set_anchor_point(anchor_point); |
| 113 SizeToContents(); // Repositions view relative to the anchor. |
| 114 } |
| 115 |
| 111 void AppListView::Close() { | 116 void AppListView::Close() { |
| 112 if (delegate_.get()) | 117 if (delegate_.get()) |
| 113 delegate_->Close(); | 118 delegate_->Close(); |
| 114 else | 119 else |
| 115 GetWidget()->Close(); | 120 GetWidget()->Close(); |
| 116 } | 121 } |
| 117 | 122 |
| 118 void AppListView::UpdateBounds() { | 123 void AppListView::UpdateBounds() { |
| 119 SizeToContents(); | 124 SizeToContents(); |
| 120 } | 125 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 } | 220 } |
| 216 | 221 |
| 217 void AppListView::InvokeResultAction(const SearchResult& result, | 222 void AppListView::InvokeResultAction(const SearchResult& result, |
| 218 int action_index, | 223 int action_index, |
| 219 int event_flags) { | 224 int event_flags) { |
| 220 if (delegate_.get()) | 225 if (delegate_.get()) |
| 221 delegate_->InvokeSearchResultAction(result, action_index, event_flags); | 226 delegate_->InvokeSearchResultAction(result, action_index, event_flags); |
| 222 } | 227 } |
| 223 | 228 |
| 224 } // namespace app_list | 229 } // namespace app_list |
| OLD | NEW |