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

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

Issue 250353003: Password bubble: refactor ManagePasswordsIconView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/cc/h Created 6 years, 8 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 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 6cec666251873df759092a4ae8064f7c9d97f218..08e5bf08662a2e691ad107879c533fe7ae185610 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -39,6 +39,7 @@
#include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
#include "chrome/browser/ui/omnibox/omnibox_popup_view.h"
#include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h"
+#include "chrome/browser/ui/passwords/manage_passwords_icon.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/toolbar/origin_chip_info.h"
#include "chrome/browser/ui/view_ids.h"
@@ -378,7 +379,7 @@ void LocationBarView::Init() {
AddChildView(open_pdf_in_reader_view_);
manage_passwords_icon_view_ = new ManagePasswordsIconView(delegate_);
- manage_passwords_icon_view_->set_id(VIEW_ID_MANAGE_PASSWORDS_ICON_BUTTON);
+ manage_passwords_icon_view_->SetState(ManagePasswordsIcon::INACTIVE_STATE);
AddChildView(manage_passwords_icon_view_);
translate_icon_view_ = new TranslateIconView(command_updater());
@@ -1199,20 +1200,11 @@ bool LocationBarView::RefreshManagePasswordsIconView() {
if (!web_contents)
return false;
const bool was_visible = manage_passwords_icon_view_->visible();
- manage_passwords_icon_view_->Update(
- ManagePasswordsBubbleUIController::FromWebContents(web_contents));
+ ManagePasswordsBubbleUIController::FromWebContents(
+ web_contents)->UpdateIconAndBubbleState(manage_passwords_icon_view_);
return was_visible != manage_passwords_icon_view_->visible();
}
-void LocationBarView::ShowManagePasswordsBubbleIfNeeded() {
- DCHECK(manage_passwords_icon_view_);
- WebContents* web_contents = GetWebContents();
- if (!web_contents)
- return;
- manage_passwords_icon_view_->ShowBubbleIfNeeded(
- ManagePasswordsBubbleUIController::FromWebContents(web_contents));
-}
-
void LocationBarView::ShowFirstRunBubbleInternal() {
#if !defined(OS_CHROMEOS)
// First run bubble doesn't make sense for Chrome OS.
@@ -1302,7 +1294,6 @@ void LocationBarView::UpdateManagePasswordsIconAndBubble() {
Layout();
SchedulePaint();
}
- ShowManagePasswordsBubbleIfNeeded();
}
void LocationBarView::UpdatePageActions() {

Powered by Google App Engine
This is Rietveld 408576698