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/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 } | 1074 } |
1075 | 1075 |
1076 NOTREACHED(); | 1076 NOTREACHED(); |
1077 } | 1077 } |
1078 | 1078 |
1079 bool LocationBarView::GetBookmarkStarVisibility() { | 1079 bool LocationBarView::GetBookmarkStarVisibility() { |
1080 DCHECK(star_view_); | 1080 DCHECK(star_view_); |
1081 return star_view_->visible(); | 1081 return star_view_->visible(); |
1082 } | 1082 } |
1083 | 1083 |
| 1084 bool LocationBarView::TestContentSettingImagePressed(size_t index) { |
| 1085 if (index >= content_setting_views_.size()) |
| 1086 return false; |
| 1087 |
| 1088 // This up-cast is necessary since the descendant class moved OnKeyPressed |
| 1089 // to the protected section. |
| 1090 views::View* image_view = content_setting_views_[index]; |
| 1091 image_view->OnKeyReleased( |
| 1092 ui::KeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_SPACE, ui::EF_NONE)); |
| 1093 return true; |
| 1094 } |
| 1095 |
1084 //////////////////////////////////////////////////////////////////////////////// | 1096 //////////////////////////////////////////////////////////////////////////////// |
1085 // LocationBarView, private views::View implementation: | 1097 // LocationBarView, private views::View implementation: |
1086 | 1098 |
1087 const char* LocationBarView::GetClassName() const { | 1099 const char* LocationBarView::GetClassName() const { |
1088 return kViewClassName; | 1100 return kViewClassName; |
1089 } | 1101 } |
1090 | 1102 |
1091 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 1103 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
1092 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); | 1104 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); |
1093 if (popup->IsOpen()) | 1105 if (popup->IsOpen()) |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 // LocationBarView, private TemplateURLServiceObserver implementation: | 1207 // LocationBarView, private TemplateURLServiceObserver implementation: |
1196 | 1208 |
1197 void LocationBarView::OnTemplateURLServiceChanged() { | 1209 void LocationBarView::OnTemplateURLServiceChanged() { |
1198 template_url_service_->RemoveObserver(this); | 1210 template_url_service_->RemoveObserver(this); |
1199 template_url_service_ = nullptr; | 1211 template_url_service_ = nullptr; |
1200 // If the browser is no longer active, let's not show the info bubble, as this | 1212 // If the browser is no longer active, let's not show the info bubble, as this |
1201 // would make the browser the active window again. | 1213 // would make the browser the active window again. |
1202 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1214 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
1203 ShowFirstRunBubble(); | 1215 ShowFirstRunBubble(); |
1204 } | 1216 } |
OLD | NEW |