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