| 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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1306 } | 1306 } |
| 1307 | 1307 |
| 1308 bool LocationBarView::ShowPageActionPopup( | 1308 bool LocationBarView::ShowPageActionPopup( |
| 1309 const extensions::Extension* extension, | 1309 const extensions::Extension* extension, |
| 1310 bool grant_tab_permissions) { | 1310 bool grant_tab_permissions) { |
| 1311 ExtensionAction* extension_action = | 1311 ExtensionAction* extension_action = |
| 1312 extensions::ExtensionActionManager::Get(profile())->GetPageAction( | 1312 extensions::ExtensionActionManager::Get(profile())->GetPageAction( |
| 1313 *extension); | 1313 *extension); |
| 1314 DCHECK(extension_action); | 1314 DCHECK(extension_action); |
| 1315 return GetPageActionView(extension_action)->image_view()->view_controller()-> | 1315 return GetPageActionView(extension_action)->image_view()->view_controller()-> |
| 1316 ExecuteAction(ExtensionPopup::SHOW, grant_tab_permissions); | 1316 ExecuteAction(grant_tab_permissions); |
| 1317 } | 1317 } |
| 1318 | 1318 |
| 1319 void LocationBarView::UpdateOpenPDFInReaderPrompt() { | 1319 void LocationBarView::UpdateOpenPDFInReaderPrompt() { |
| 1320 open_pdf_in_reader_view_->Update( | 1320 open_pdf_in_reader_view_->Update( |
| 1321 GetToolbarModel()->input_in_progress() ? NULL : GetWebContents()); | 1321 GetToolbarModel()->input_in_progress() ? NULL : GetWebContents()); |
| 1322 Layout(); | 1322 Layout(); |
| 1323 SchedulePaint(); | 1323 SchedulePaint(); |
| 1324 } | 1324 } |
| 1325 | 1325 |
| 1326 void LocationBarView::UpdateGeneratedCreditCardView() { | 1326 void LocationBarView::UpdateGeneratedCreditCardView() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 NOTREACHED(); | 1384 NOTREACHED(); |
| 1385 return NULL; | 1385 return NULL; |
| 1386 } | 1386 } |
| 1387 | 1387 |
| 1388 void LocationBarView::TestPageActionPressed(size_t index) { | 1388 void LocationBarView::TestPageActionPressed(size_t index) { |
| 1389 size_t current = 0; | 1389 size_t current = 0; |
| 1390 for (size_t i = 0; i < page_action_views_.size(); ++i) { | 1390 for (size_t i = 0; i < page_action_views_.size(); ++i) { |
| 1391 if (page_action_views_[i]->visible()) { | 1391 if (page_action_views_[i]->visible()) { |
| 1392 if (current == index) { | 1392 if (current == index) { |
| 1393 page_action_views_[i]->image_view()->view_controller()-> | 1393 page_action_views_[i]->image_view()->view_controller()-> |
| 1394 ExecuteAction(ExtensionPopup::SHOW, true); | 1394 ExecuteAction(true); |
| 1395 return; | 1395 return; |
| 1396 } | 1396 } |
| 1397 ++current; | 1397 ++current; |
| 1398 } | 1398 } |
| 1399 } | 1399 } |
| 1400 | 1400 |
| 1401 NOTREACHED(); | 1401 NOTREACHED(); |
| 1402 } | 1402 } |
| 1403 | 1403 |
| 1404 bool LocationBarView::GetBookmarkStarVisibility() { | 1404 bool LocationBarView::GetBookmarkStarVisibility() { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1657 | 1657 |
| 1658 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1658 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1659 const SearchModel::State& new_state) { | 1659 const SearchModel::State& new_state) { |
| 1660 const bool visible = !GetToolbarModel()->input_in_progress() && | 1660 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1661 new_state.voice_search_supported; | 1661 new_state.voice_search_supported; |
| 1662 if (mic_search_view_->visible() != visible) { | 1662 if (mic_search_view_->visible() != visible) { |
| 1663 mic_search_view_->SetVisible(visible); | 1663 mic_search_view_->SetVisible(visible); |
| 1664 Layout(); | 1664 Layout(); |
| 1665 } | 1665 } |
| 1666 } | 1666 } |
| OLD | NEW |