| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1348 } | 1348 } |
| 1349 | 1349 |
| 1350 void BrowserView::ShowWebsiteSettings( | 1350 void BrowserView::ShowWebsiteSettings( |
| 1351 Profile* profile, | 1351 Profile* profile, |
| 1352 content::WebContents* web_contents, | 1352 content::WebContents* web_contents, |
| 1353 const GURL& virtual_url, | 1353 const GURL& virtual_url, |
| 1354 const security_state::SecurityStateModel::SecurityInfo& security_info) { | 1354 const security_state::SecurityStateModel::SecurityInfo& security_info) { |
| 1355 // Some browser windows have a location icon embedded in the frame. Try to | 1355 // Some browser windows have a location icon embedded in the frame. Try to |
| 1356 // use that if it exists. If it doesn't exist, use the location icon from | 1356 // use that if it exists. If it doesn't exist, use the location icon from |
| 1357 // the location bar. | 1357 // the location bar. |
| 1358 views::View* popup_anchor = frame_->GetLocationIconView(); | 1358 views::View* popup_anchor = |
| 1359 ui::MaterialDesignController::IsSecondaryUiMaterial() |
| 1360 ? toolbar_->location_bar() |
| 1361 : frame_->GetLocationIconView(); |
| 1359 if (!popup_anchor) | 1362 if (!popup_anchor) |
| 1360 popup_anchor = GetLocationBarView()->location_icon_view()->GetImageView(); | 1363 popup_anchor = GetLocationBarView()->location_icon_view()->GetImageView(); |
| 1361 | 1364 |
| 1362 WebsiteSettingsPopupView::ShowPopup(popup_anchor, gfx::Rect(), profile, | 1365 WebsiteSettingsPopupView::ShowPopup(popup_anchor, gfx::Rect(), profile, |
| 1363 web_contents, virtual_url, security_info); | 1366 web_contents, virtual_url, security_info); |
| 1364 } | 1367 } |
| 1365 | 1368 |
| 1366 void BrowserView::ShowAppMenu() { | 1369 void BrowserView::ShowAppMenu() { |
| 1367 if (!toolbar_->app_menu_button()) | 1370 if (!toolbar_->app_menu_button()) |
| 1368 return; | 1371 return; |
| (...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2662 } | 2665 } |
| 2663 | 2666 |
| 2664 extensions::ActiveTabPermissionGranter* | 2667 extensions::ActiveTabPermissionGranter* |
| 2665 BrowserView::GetActiveTabPermissionGranter() { | 2668 BrowserView::GetActiveTabPermissionGranter() { |
| 2666 content::WebContents* web_contents = GetActiveWebContents(); | 2669 content::WebContents* web_contents = GetActiveWebContents(); |
| 2667 if (!web_contents) | 2670 if (!web_contents) |
| 2668 return nullptr; | 2671 return nullptr; |
| 2669 return extensions::TabHelper::FromWebContents(web_contents) | 2672 return extensions::TabHelper::FromWebContents(web_contents) |
| 2670 ->active_tab_permission_granter(); | 2673 ->active_tab_permission_granter(); |
| 2671 } | 2674 } |
| OLD | NEW |