Chromium Code Reviews| 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 "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "chrome/browser/search/search.h" | 9 #include "chrome/browser/search/search.h" |
| 10 #include "chrome/browser/themes/theme_properties.h" | 10 #include "chrome/browser/themes/theme_properties.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 location_bar_view_(location_bar_view), | 62 location_bar_view_(location_bar_view), |
| 63 font_list_(font_list), | 63 font_list_(font_list), |
| 64 ignore_mouse_drag_(false), | 64 ignore_mouse_drag_(false), |
| 65 size_animation_(this), | 65 size_animation_(this), |
| 66 start_margin_(0), | 66 start_margin_(0), |
| 67 end_margin_(0) { | 67 end_margin_(0) { |
| 68 // The contents is owned by the LocationBarView. | 68 // The contents is owned by the LocationBarView. |
| 69 set_owned_by_client(); | 69 set_owned_by_client(); |
| 70 | 70 |
| 71 ui::ThemeProvider* theme = location_bar_view_->GetThemeProvider(); | 71 ui::ThemeProvider* theme = location_bar_view_->GetThemeProvider(); |
| 72 top_shadow_ = theme->GetImageSkiaNamed(IDR_OMNIBOX_DROPDOWN_SHADOW_TOP); | 72 if (ui::MaterialDesignController::IsModeMaterial()) |
| 73 top_shadow_ = theme->GetImageSkiaNamed(IDR_OMNIBOX_DROPDOWN_SHADOW_TOP); | |
|
sky
2015/09/03 13:20:10
member initialize this to nullptr so the value is
Evan Stade
2015/09/03 13:53:07
+tdanderson for this file
I'd say you could/shoul
tdanderson
2015/09/03 14:16:28
On line 74? Sounds fine by me, would you mind maki
Evan Stade
2015/09/03 16:09:40
then again, maybe IsModeMaterial() is better becau
jackhou1
2015/09/04 00:47:18
Done.
jackhou1
2015/09/04 00:47:18
Re-arranged lines 72-76 to make it a bit clearer.
| |
| 73 int bottom_shadow_asset = ui::MaterialDesignController::IsModeMaterial() ? | 74 int bottom_shadow_asset = ui::MaterialDesignController::IsModeMaterial() ? |
| 74 IDR_OMNIBOX_DROPDOWN_SHADOW_BOTTOM : IDR_BUBBLE_B; | 75 IDR_OMNIBOX_DROPDOWN_SHADOW_BOTTOM : IDR_BUBBLE_B; |
| 75 bottom_shadow_ = theme->GetImageSkiaNamed(bottom_shadow_asset); | 76 bottom_shadow_ = theme->GetImageSkiaNamed(bottom_shadow_asset); |
| 76 | 77 |
| 77 SetEventTargeter( | 78 SetEventTargeter( |
| 78 scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); | 79 scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); |
| 79 } | 80 } |
| 80 | 81 |
| 81 void OmniboxPopupContentsView::Init() { | 82 void OmniboxPopupContentsView::Init() { |
| 82 // This can't be done in the constructor as at that point we aren't | 83 // This can't be done in the constructor as at that point we aren't |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 537 size_t index = GetIndexForPoint(event.location()); | 538 size_t index = GetIndexForPoint(event.location()); |
| 538 if (!HasMatchAt(index)) | 539 if (!HasMatchAt(index)) |
| 539 return; | 540 return; |
| 540 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, | 541 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, |
| 541 GURL(), base::string16(), index); | 542 GURL(), base::string16(), index); |
| 542 } | 543 } |
| 543 | 544 |
| 544 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 545 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
| 545 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 546 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
| 546 } | 547 } |
| OLD | NEW |