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 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1308 | 1308 |
1309 bool LocationBarView::ShowPageActionPopup( | 1309 bool LocationBarView::ShowPageActionPopup( |
1310 const extensions::Extension* extension, | 1310 const extensions::Extension* extension, |
1311 bool grant_tab_permissions) { | 1311 bool grant_tab_permissions) { |
1312 ExtensionAction* extension_action = | 1312 ExtensionAction* extension_action = |
1313 extensions::ExtensionActionManager::Get(profile())->GetPageAction( | 1313 extensions::ExtensionActionManager::Get(profile())->GetPageAction( |
1314 *extension); | 1314 *extension); |
1315 CHECK(extension_action); | 1315 CHECK(extension_action); |
1316 PageActionWithBadgeView* page_action_view = | 1316 PageActionWithBadgeView* page_action_view = |
1317 GetPageActionView(extension_action); | 1317 GetPageActionView(extension_action); |
1318 CHECK(page_action_view); | 1318 if (!page_action_view) { |
1319 CHECK(GetWebContents()); | |
Mike Wittman
2014/12/19 19:13:36
It would be better to check here that WebContents
danduong
2014/12/19 19:15:08
I'll probably add both checks.
| |
1320 CHECK(!is_popup_mode_); | |
1321 CHECK(!extensions::FeatureSwitch::extension_action_redesign()->IsEnabled()); | |
1322 CHECK(false); | |
1323 } | |
1319 PageActionImageView* page_action_image_view = page_action_view->image_view(); | 1324 PageActionImageView* page_action_image_view = page_action_view->image_view(); |
1320 CHECK(page_action_image_view); | 1325 CHECK(page_action_image_view); |
1321 ExtensionActionViewController* extension_action_view_controller = | 1326 ExtensionActionViewController* extension_action_view_controller = |
1322 page_action_image_view->view_controller(); | 1327 page_action_image_view->view_controller(); |
1323 CHECK(extension_action_view_controller); | 1328 CHECK(extension_action_view_controller); |
1324 return extension_action_view_controller->ExecuteAction(grant_tab_permissions); | 1329 return extension_action_view_controller->ExecuteAction(grant_tab_permissions); |
1325 } | 1330 } |
1326 | 1331 |
1327 void LocationBarView::UpdateOpenPDFInReaderPrompt() { | 1332 void LocationBarView::UpdateOpenPDFInReaderPrompt() { |
1328 open_pdf_in_reader_view_->Update( | 1333 open_pdf_in_reader_view_->Update( |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1665 | 1670 |
1666 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1671 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
1667 const SearchModel::State& new_state) { | 1672 const SearchModel::State& new_state) { |
1668 const bool visible = !GetToolbarModel()->input_in_progress() && | 1673 const bool visible = !GetToolbarModel()->input_in_progress() && |
1669 new_state.voice_search_supported; | 1674 new_state.voice_search_supported; |
1670 if (mic_search_view_->visible() != visible) { | 1675 if (mic_search_view_->visible() != visible) { |
1671 mic_search_view_->SetVisible(visible); | 1676 mic_search_view_->SetVisible(visible); |
1672 Layout(); | 1677 Layout(); |
1673 } | 1678 } |
1674 } | 1679 } |
OLD | NEW |