OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/web_app_left_header_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/web_app_left_header_view_ash.h" |
6 | 6 |
7 #include "ash/common/frame/caption_buttons/frame_caption_button.h" | 7 #include "ash/common/frame/caption_buttons/frame_caption_button.h" |
8 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" | 8 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/ssl/chrome_security_state_model_client.h" | 10 #include "chrome/browser/ssl/security_state_tab_helper.h" |
11 #include "chrome/browser/ui/browser_commands.h" | 11 #include "chrome/browser/ui/browser_commands.h" |
12 #include "chrome/browser/ui/views/frame/browser_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 13 #include "components/security_state/core/security_state.h" |
13 #include "components/toolbar/toolbar_model.h" | 14 #include "components/toolbar/toolbar_model.h" |
14 #include "content/public/browser/navigation_entry.h" | 15 #include "content/public/browser/navigation_entry.h" |
15 #include "ui/gfx/vector_icons_public.h" | 16 #include "ui/gfx/vector_icons_public.h" |
16 #include "ui/views/layout/box_layout.h" | 17 #include "ui/views/layout/box_layout.h" |
17 | 18 |
18 // static | 19 // static |
19 const char WebAppLeftHeaderView::kViewClassName[] = "WebAppLeftHeaderView"; | 20 const char WebAppLeftHeaderView::kViewClassName[] = "WebAppLeftHeaderView"; |
20 | 21 |
21 WebAppLeftHeaderView::WebAppLeftHeaderView(BrowserView* browser_view) | 22 WebAppLeftHeaderView::WebAppLeftHeaderView(BrowserView* browser_view) |
22 : browser_view_(browser_view) { | 23 : browser_view_(browser_view) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 content::WebContents* tab = browser_view_->GetActiveWebContents(); | 82 content::WebContents* tab = browser_view_->GetActiveWebContents(); |
82 if (!tab) | 83 if (!tab) |
83 return; | 84 return; |
84 | 85 |
85 // Important to use GetVisibleEntry to match what's showing in the title area. | 86 // Important to use GetVisibleEntry to match what's showing in the title area. |
86 content::NavigationEntry* nav_entry = tab->GetController().GetVisibleEntry(); | 87 content::NavigationEntry* nav_entry = tab->GetController().GetVisibleEntry(); |
87 // The visible entry can be NULL in the case of window.open(""). | 88 // The visible entry can be NULL in the case of window.open(""). |
88 if (!nav_entry) | 89 if (!nav_entry) |
89 return; | 90 return; |
90 | 91 |
91 ChromeSecurityStateModelClient* security_model_client = | 92 SecurityStateTabHelper* helper = SecurityStateTabHelper::FromWebContents(tab); |
92 ChromeSecurityStateModelClient::FromWebContents(tab); | 93 DCHECK(helper); |
93 DCHECK(security_model_client); | |
94 | 94 |
95 security_state::SecurityStateModel::SecurityInfo security_info; | 95 security_state::SecurityInfo security_info; |
96 security_model_client->GetSecurityInfo(&security_info); | 96 helper->GetSecurityInfo(&security_info); |
97 chrome::ShowWebsiteSettings(browser_view_->browser(), tab, | 97 chrome::ShowWebsiteSettings(browser_view_->browser(), tab, |
98 nav_entry->GetVirtualURL(), security_info); | 98 nav_entry->GetVirtualURL(), security_info); |
99 } | 99 } |
OLD | NEW |