Chromium Code Reviews| 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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 846 } | 846 } |
| 847 | 847 |
| 848 void LocationBarView::ShowFirstRunBubbleInternal() { | 848 void LocationBarView::ShowFirstRunBubbleInternal() { |
| 849 // First run bubble doesn't make sense for Chrome OS. | 849 // First run bubble doesn't make sense for Chrome OS. |
| 850 #if !defined(OS_CHROMEOS) | 850 #if !defined(OS_CHROMEOS) |
| 851 WebContents* web_contents = delegate_->GetWebContents(); | 851 WebContents* web_contents = delegate_->GetWebContents(); |
| 852 if (!web_contents) | 852 if (!web_contents) |
| 853 return; | 853 return; |
| 854 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); | 854 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); |
| 855 if (browser) | 855 if (browser) |
| 856 FirstRunBubble::ShowBubble(browser, location_icon_view_); | 856 FirstRunBubble::ShowBubble(browser, location_icon_view_->GetImageView()); |
|
Peter Kasting
2017/02/23 22:06:03
It seems like this should just call GetSecurityBub
tapted
2017/02/23 23:19:48
Done.
I had debated this and couldn't decide :).
| |
| 857 #endif | 857 #endif |
| 858 } | 858 } |
| 859 | 859 |
| 860 base::string16 LocationBarView::GetLocationIconText() const { | 860 base::string16 LocationBarView::GetLocationIconText() const { |
| 861 if (GetToolbarModel()->GetURL().SchemeIs(content::kChromeUIScheme)) | 861 if (GetToolbarModel()->GetURL().SchemeIs(content::kChromeUIScheme)) |
| 862 return l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME); | 862 return l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME); |
| 863 | 863 |
| 864 const base::string16 extension_name = GetExtensionName( | 864 const base::string16 extension_name = GetExtensionName( |
| 865 GetToolbarModel()->GetURL(), delegate_->GetWebContents()); | 865 GetToolbarModel()->GetURL(), delegate_->GetWebContents()); |
| 866 if (!extension_name.empty()) | 866 if (!extension_name.empty()) |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1207 // LocationBarView, private TemplateURLServiceObserver implementation: | 1207 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1208 | 1208 |
| 1209 void LocationBarView::OnTemplateURLServiceChanged() { | 1209 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1210 template_url_service_->RemoveObserver(this); | 1210 template_url_service_->RemoveObserver(this); |
| 1211 template_url_service_ = nullptr; | 1211 template_url_service_ = nullptr; |
| 1212 // If the browser is no longer active, let's not show the info bubble, as this | 1212 // If the browser is no longer active, let's not show the info bubble, as this |
| 1213 // would make the browser the active window again. | 1213 // would make the browser the active window again. |
| 1214 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1214 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1215 ShowFirstRunBubble(); | 1215 ShowFirstRunBubble(); |
| 1216 } | 1216 } |
| OLD | NEW |