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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 92073003: [SiteChip] Draw site chip icon and site title. Drag support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use new image assets Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 5905a421a5982840e3fd43515024413cdecfa23a..a1c7694fb19efda39bb51021ee64fdcaf7b22a80 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -55,6 +55,7 @@
#include "chrome/browser/ui/views/location_bar/zoom_view.h"
#include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
#include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h"
+#include "chrome/browser/ui/views/toolbar/site_chip_view.h"
#include "chrome/browser/ui/zoom/zoom_controller.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -180,6 +181,7 @@ LocationBarView::LocationBarView(Browser* browser,
open_pdf_in_reader_view_(NULL),
manage_passwords_icon_view_(NULL),
script_bubble_icon_view_(NULL),
+ site_chip_view_(NULL),
translate_icon_view_(NULL),
star_view_(NULL),
is_popup_mode_(is_popup_mode),
@@ -674,8 +676,9 @@ void LocationBarView::Layout() {
selected_keyword_view_->set_is_extension_icon(false);
}
}
- } else if (GetToolbarModel()->GetSecurityLevel(false) ==
- ToolbarModel::EV_SECURE) {
+ } else if (!site_chip_view_ &&
+ (GetToolbarModel()->GetSecurityLevel(false) ==
Peter Kasting 2013/12/10 03:28:39 Nit: Indent 4, a la } else if (!site_chip_view_
Greg Billock 2013/12/10 17:37:59 Done.
+ ToolbarModel::EV_SECURE)) {
ev_bubble_view_->SetLabel(GetToolbarModel()->GetEVCertName());
// The largest fraction of the omnibox that can be taken by the EV bubble.
const double kMaxBubbleFraction = 0.5;
@@ -911,10 +914,16 @@ void LocationBarView::SelectAll() {
}
views::ImageView* LocationBarView::GetLocationIconView() {
+ if (site_chip_view_)
+ return site_chip_view_->location_icon_view();
Peter Kasting 2013/12/10 03:28:39 Tiny nit: I'd probably use ?: here and in the next
Greg Billock 2013/12/10 17:37:59 Done.
+
return location_icon_view_;
}
const views::ImageView* LocationBarView::GetLocationIconView() const {
+ if (site_chip_view_)
+ return site_chip_view_->location_icon_view();
+
return location_icon_view_;
}
@@ -974,6 +983,9 @@ void LocationBarView::OnChanged() {
GetThemeProvider()->GetImageSkiaNamed(omnibox_view_->GetIcon()));
location_icon_view_->ShowTooltip(!GetOmniboxView()->IsEditingOrEmpty());
+ if (site_chip_view_)
+ site_chip_view_->OnChanged();
+
Layout();
SchedulePaint();
}

Powered by Google App Engine
This is Rietveld 408576698