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

Unified Diff: chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm

Issue 473423005: Revert of Hook up the Mac password bubble to the browser and add browser tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/cocoa/location_bar/manage_passwords_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm b/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm
index 4e3e1c854043ef62094f32435fa7b985878acc47..4f9528f932eeb0dba71d014b62ecf36899e5e81b 100644
--- a/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.mm
@@ -8,7 +8,6 @@
#include "chrome/browser/command_updater.h"
#include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
#include "chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_cocoa.h"
-#include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
#include "ui/base/l10n/l10n_util_mac.h"
// ManagePasswordsIconCocoa
@@ -28,12 +27,10 @@
// ManagePasswordsDecoration
ManagePasswordsDecoration::ManagePasswordsDecoration(
- CommandUpdater* command_updater,
- LocationBarViewMac* location_bar)
+ CommandUpdater* command_updater)
: command_updater_(command_updater),
- location_bar_(location_bar),
icon_(new ManagePasswordsIconCocoa(this)) {
- UpdateUIState();
+ UpdateVisibleUI();
}
ManagePasswordsDecoration::~ManagePasswordsDecoration() {}
@@ -48,12 +45,8 @@
}
bool ManagePasswordsDecoration::OnMousePressed(NSRect frame, NSPoint location) {
- bool result = ImageDecoration::OnMousePressed(frame, location);
- if (ManagePasswordsBubbleCocoa::instance())
- ManagePasswordsBubbleCocoa::instance()->Close();
- else
- command_updater_->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE);
- return result;
+ command_updater_->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE);
+ return true;
}
NSString* ManagePasswordsDecoration::GetToolTip() {
@@ -62,13 +55,7 @@
: nil;
}
-void ManagePasswordsDecoration::OnChange() {
- // |location_bar_| can be NULL in tests.
- if (location_bar_)
- location_bar_->OnDecorationsChanged();
-}
-
-void ManagePasswordsDecoration::UpdateUIState() {
+void ManagePasswordsDecoration::UpdateVisibleUI() {
if (icon_->state() == password_manager::ui::INACTIVE_STATE) {
SetVisible(false);
SetImage(nil);
@@ -79,8 +66,3 @@
SetVisible(true);
SetImage(OmniboxViewMac::ImageForResource(icon_->icon_id()));
}
-
-void ManagePasswordsDecoration::UpdateVisibleUI() {
- UpdateUIState();
- OnChange();
-}

Powered by Google App Engine
This is Rietveld 408576698