Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 2705323004: Anchor the first run bubble off the location bar icon's ImageView. (Closed)
Patch Set: GetSecurityBubbleAnchorView Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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, GetSecurityBubbleAnchorView());
Peter Kasting 2017/02/24 01:55:54 (Still wondering if maybe this should be renamed t
tapted 2017/02/24 02:01:24 If it's OK, I might defer the rename.. Someone mig
Peter Kasting 2017/02/24 02:05:16 Ha! I'm pretty sure THIS one, at least, I know ho
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698