| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 zoom_view_(nullptr), | 135 zoom_view_(nullptr), |
| 136 open_pdf_in_reader_view_(nullptr), | 136 open_pdf_in_reader_view_(nullptr), |
| 137 manage_passwords_icon_view_(nullptr), | 137 manage_passwords_icon_view_(nullptr), |
| 138 save_credit_card_icon_view_(nullptr), | 138 save_credit_card_icon_view_(nullptr), |
| 139 translate_icon_view_(nullptr), | 139 translate_icon_view_(nullptr), |
| 140 star_view_(nullptr), | 140 star_view_(nullptr), |
| 141 size_animation_(this), | 141 size_animation_(this), |
| 142 is_popup_mode_(is_popup_mode), | 142 is_popup_mode_(is_popup_mode), |
| 143 show_focus_rect_(false), | 143 show_focus_rect_(false), |
| 144 template_url_service_(NULL), | 144 template_url_service_(NULL), |
| 145 dropdown_animation_offset_(0), | |
| 146 web_contents_null_at_last_refresh_(true) { | 145 web_contents_null_at_last_refresh_(true) { |
| 147 edit_bookmarks_enabled_.Init( | 146 edit_bookmarks_enabled_.Init( |
| 148 bookmarks::prefs::kEditBookmarksEnabled, profile->GetPrefs(), | 147 bookmarks::prefs::kEditBookmarksEnabled, profile->GetPrefs(), |
| 149 base::Bind(&LocationBarView::UpdateWithoutTabRestore, | 148 base::Bind(&LocationBarView::UpdateWithoutTabRestore, |
| 150 base::Unretained(this))); | 149 base::Unretained(this))); |
| 151 | 150 |
| 152 ui_zoom::ZoomEventManager::GetForBrowserContext(profile) | 151 ui_zoom::ZoomEventManager::GetForBrowserContext(profile) |
| 153 ->AddZoomEventManagerObserver(this); | 152 ->AddZoomEventManagerObserver(this); |
| 154 } | 153 } |
| 155 | 154 |
| (...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 return delegate_->GetToolbarModel(); | 1369 return delegate_->GetToolbarModel(); |
| 1371 } | 1370 } |
| 1372 | 1371 |
| 1373 //////////////////////////////////////////////////////////////////////////////// | 1372 //////////////////////////////////////////////////////////////////////////////// |
| 1374 // LocationBarView, private DropdownBarHostDelegate implementation: | 1373 // LocationBarView, private DropdownBarHostDelegate implementation: |
| 1375 | 1374 |
| 1376 void LocationBarView::SetFocusAndSelection(bool select_all) { | 1375 void LocationBarView::SetFocusAndSelection(bool select_all) { |
| 1377 FocusLocation(select_all); | 1376 FocusLocation(select_all); |
| 1378 } | 1377 } |
| 1379 | 1378 |
| 1380 void LocationBarView::SetAnimationOffset(int offset) { | |
| 1381 dropdown_animation_offset_ = offset; | |
| 1382 } | |
| 1383 | |
| 1384 //////////////////////////////////////////////////////////////////////////////// | 1379 //////////////////////////////////////////////////////////////////////////////// |
| 1385 // LocationBarView, private TemplateURLServiceObserver implementation: | 1380 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1386 | 1381 |
| 1387 void LocationBarView::OnTemplateURLServiceChanged() { | 1382 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1388 template_url_service_->RemoveObserver(this); | 1383 template_url_service_->RemoveObserver(this); |
| 1389 template_url_service_ = nullptr; | 1384 template_url_service_ = nullptr; |
| 1390 // If the browser is no longer active, let's not show the info bubble, as this | 1385 // If the browser is no longer active, let's not show the info bubble, as this |
| 1391 // would make the browser the active window again. | 1386 // would make the browser the active window again. |
| 1392 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1387 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1393 ShowFirstRunBubble(); | 1388 ShowFirstRunBubble(); |
| 1394 } | 1389 } |
| OLD | NEW |