Skip to content

Commit

Permalink
Delete cocoa/passwords folder.
Browse files Browse the repository at this point in the history
All those contorls are rendered with MacViews in M66.

Bug: 832676
Change-Id: I23ba5ad92fc4af46ed2e7adb3ad9607857cab443
Reviewed-on: https://chromium-review.googlesource.com/1014113
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551473}
  • Loading branch information
Vasilii Sukhanov authored and Commit Bot committed Apr 17, 2018
1 parent d019d58 commit e1b73f4
Show file tree
Hide file tree
Showing 67 changed files with 22 additions and 6,049 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions chrome/app/theme/theme_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@
<structure type="chrome_scaled_image" name="IDR_RESTORE_BUTTON_MASK" file="common/restore_button_mask.png" />
<if expr="is_macosx">
<structure type="chrome_scaled_image" name="IDR_SAFEBROWSING_WARNING" file="legacy/safebrowsing_warning.png" />
<structure type="chrome_scaled_image" name="IDR_SAVE_PASSWORD_ACTIVE" file="legacy/save_password_active.png" />
<structure type="chrome_scaled_image" name="IDR_SAVE_PASSWORD_INACTIVE" file="legacy/save_password_inactive.png" />
</if>
<structure type="chrome_scaled_image" name="IDR_SCREEN_CAPTURE_NOTIFICATION_GRIP" file="screen_capture_notification_grip.png" />
<structure type="chrome_scaled_image" name="IDR_SCREENSHOT_NOTIFICATION_ICON" file="common/notification_screenshot_icon.png" />
Expand Down
40 changes: 0 additions & 40 deletions chrome/browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -436,45 +436,6 @@ split_static_library("ui") {
"cocoa/password_reuse_warning_dialog_cocoa.mm",
"cocoa/password_reuse_warning_view_controller.h",
"cocoa/password_reuse_warning_view_controller.mm",
"cocoa/passwords/account_avatar_fetcher_manager.h",
"cocoa/passwords/account_avatar_fetcher_manager.mm",
"cocoa/passwords/account_chooser_view_controller.h",
"cocoa/passwords/account_chooser_view_controller.mm",
"cocoa/passwords/auto_signin_view_controller.h",
"cocoa/passwords/auto_signin_view_controller.mm",
"cocoa/passwords/autosignin_prompt_view_controller.h",
"cocoa/passwords/autosignin_prompt_view_controller.mm",
"cocoa/passwords/base_passwords_content_view_controller.h",
"cocoa/passwords/base_passwords_content_view_controller.mm",
"cocoa/passwords/confirmation_password_saved_view_controller.h",
"cocoa/passwords/confirmation_password_saved_view_controller.mm",
"cocoa/passwords/credential_item_button.h",
"cocoa/passwords/credential_item_button.mm",
"cocoa/passwords/credentials_selection_view_cocoa.h",
"cocoa/passwords/credentials_selection_view_cocoa.mm",
"cocoa/passwords/manage_passwords_view_controller.h",
"cocoa/passwords/manage_passwords_view_controller.mm",
"cocoa/passwords/password_item_views.h",
"cocoa/passwords/password_prompt_bridge_interface.h",
"cocoa/passwords/password_prompt_view_bridge.h",
"cocoa/passwords/password_prompt_view_bridge.mm",
"cocoa/passwords/password_prompt_views_mac.mm",
"cocoa/passwords/passwords_bubble_cocoa.h",
"cocoa/passwords/passwords_bubble_cocoa.mm",
"cocoa/passwords/passwords_bubble_controller.h",
"cocoa/passwords/passwords_bubble_controller.mm",
"cocoa/passwords/passwords_bubble_utils.h",
"cocoa/passwords/passwords_bubble_utils.mm",
"cocoa/passwords/passwords_list_view_controller.h",
"cocoa/passwords/passwords_list_view_controller.mm",
"cocoa/passwords/pending_password_view_controller.h",
"cocoa/passwords/pending_password_view_controller.mm",
"cocoa/passwords/save_pending_password_view_controller.h",
"cocoa/passwords/save_pending_password_view_controller.mm",
"cocoa/passwords/signin_promo_view_controller.h",
"cocoa/passwords/signin_promo_view_controller.mm",
"cocoa/passwords/update_pending_password_view_controller.h",
"cocoa/passwords/update_pending_password_view_controller.mm",
"cocoa/permission_bubble/chooser_bubble_ui_cocoa.h",
"cocoa/permission_bubble/chooser_bubble_ui_cocoa.mm",
"cocoa/permission_bubble/chooser_bubble_ui_views_mac.mm",
Expand Down Expand Up @@ -2557,7 +2518,6 @@ split_static_library("ui") {
"cocoa/password_reuse_warning_dialog_cocoa.mm",
"cocoa/password_reuse_warning_view_controller.h",
"cocoa/password_reuse_warning_view_controller.mm",
"cocoa/passwords/password_prompt_views_mac.mm",
"cocoa/simple_message_box_bridge_views.mm",
"cocoa/simple_message_box_cocoa.h",
"cocoa/simple_message_box_cocoa.mm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class ManagePasswordsIconCocoa : public ManagePasswordsIcon {
void UpdateVisibleUI() override;
void OnChangingState() override;

int icon_id() { return icon_id_; }
int tooltip_text_id() { return tooltip_text_id_; }

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "chrome/browser/ui/cocoa/browser_dialogs_views_mac.h"
#include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
#include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
#include "chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.h"
#import "chrome/browser/ui/cocoa/themed_window.h"
#include "chrome/browser/ui/views/passwords/password_bubble_view_base.h"
#include "ui/base/l10n/l10n_util_mac.h"
Expand Down Expand Up @@ -48,10 +47,7 @@
UpdateUIState();
}

ManagePasswordsDecoration::~ManagePasswordsDecoration() {
if (ManagePasswordsBubbleCocoa::instance())
ManagePasswordsBubbleCocoa::instance()->SetIcon(NULL);
}
ManagePasswordsDecoration::~ManagePasswordsDecoration() = default;

NSPoint ManagePasswordsDecoration::GetBubblePointInFrame(NSRect frame) {
const NSRect draw_frame = GetDrawRectInFrame(frame);
Expand Down Expand Up @@ -102,12 +98,8 @@
}

void ManagePasswordsDecoration::HideBubble() {
if (chrome::ShowAllDialogsWithViewsToolkit()) {
if (IsBubbleShowing())
PasswordBubbleViewBase::CloseCurrentBubble();
} else if (icon()->active() && ManagePasswordsBubbleCocoa::instance()) {
ManagePasswordsBubbleCocoa::instance()->Close();
}
if (IsBubbleShowing())
PasswordBubbleViewBase::CloseCurrentBubble();
}

const gfx::VectorIcon* ManagePasswordsDecoration::GetMaterialVectorIcon()
Expand All @@ -118,7 +110,5 @@
}

bool ManagePasswordsDecoration::IsBubbleShowing() {
if (chrome::ShowAllDialogsWithViewsToolkit())
return PasswordBubbleViewBase::manage_password_bubble() != nullptr;
return ManagePasswordsBubbleCocoa::instance() != nullptr;
return PasswordBubbleViewBase::manage_password_bubble() != nullptr;
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ bool ImagesEqual(NSImage* left, NSImage* right) {
struct ManagePasswordsTestCase {
// Inputs
password_manager::ui::State state;
bool active;

// Outputs
bool visible;
int image;
int toolTip;
};

Expand All @@ -99,73 +97,31 @@ bool ImagesEqual(NSImage* left, NSImage* right) {

TEST_P(ManagePasswordsDecorationStateTest, TestState) {
decoration()->icon()->SetState(GetParam().state);
decoration()->icon()->SetActive(GetParam().active);
EXPECT_EQ(GetParam().visible, decoration()->IsVisible());
NSImage* expected_image = nil;
if (GetParam().image) {
// IDR_SAVE_PASSWORD_ACTIVE and IDR_SAVE_PASSWORD_INACTIVE map to
// kKeyIcon in Material Design; fail the test if somehow some other
// value is present.
EXPECT_TRUE(GetParam().image == IDR_SAVE_PASSWORD_ACTIVE ||
GetParam().image == IDR_SAVE_PASSWORD_INACTIVE);
const int kIconSize = 16;
expected_image = NSImageFromImageSkia(
gfx::CreateVectorIcon(kKeyIcon, kIconSize, gfx::kChromeIconGrey));
}
const int kIconSize = 16;
NSImage* expected_image =
GetParam().state == password_manager::ui::INACTIVE_STATE
? nil
: NSImageFromImageSkia(gfx::CreateVectorIcon(kKeyIcon, kIconSize,
gfx::kChromeIconGrey));
EXPECT_TRUE(ImagesEqual(expected_image, decoration()->GetImage()));
EXPECT_NSEQ(GetParam().toolTip
? l10n_util::GetNSStringWithFixup(GetParam().toolTip)
: nil,
decoration()->GetToolTip());
}

ManagePasswordsTestCase managerInactiveOnPageAndEnabledTests[] = {
ManagePasswordsTestCase testCases[] = {
{.state = password_manager::ui::INACTIVE_STATE,
.active = true,
.visible = false,
.image = 0,
.toolTip = 0},
{.state = password_manager::ui::INACTIVE_STATE,
.active = false,
.visible = false,
.image = 0,
.toolTip = 0}};

INSTANTIATE_TEST_CASE_P(
ManagerInactiveOnPage,
ManagePasswordsDecorationStateTest,
::testing::ValuesIn(managerInactiveOnPageAndEnabledTests));

ManagePasswordsTestCase managerActiveOnPageAndEnabledTests[] = {
{.state = password_manager::ui::MANAGE_STATE,
.active = true,
.visible = true,
.image = IDR_SAVE_PASSWORD_ACTIVE,
.toolTip = IDS_PASSWORD_MANAGER_TOOLTIP_MANAGE},
{.state = password_manager::ui::MANAGE_STATE,
.active = false,
.visible = true,
.image = IDR_SAVE_PASSWORD_INACTIVE,
.toolTip = IDS_PASSWORD_MANAGER_TOOLTIP_MANAGE}};

INSTANTIATE_TEST_CASE_P(
ManagerActiveOnPageAndEnabled,
ManagePasswordsDecorationStateTest,
::testing::ValuesIn(managerActiveOnPageAndEnabledTests));

ManagePasswordsTestCase managerActiveOnPageAndPendingTests[] = {
{.state = password_manager::ui::PENDING_PASSWORD_STATE,
.active = true,
.visible = true,
.image = IDR_SAVE_PASSWORD_ACTIVE,
.toolTip = IDS_PASSWORD_MANAGER_TOOLTIP_SAVE},
{.state = password_manager::ui::PENDING_PASSWORD_STATE,
.active = false,
.visible = true,
.image = IDR_SAVE_PASSWORD_INACTIVE,
.toolTip = IDS_PASSWORD_MANAGER_TOOLTIP_SAVE}};

INSTANTIATE_TEST_CASE_P(
ManagerActiveOnPageAndPending,
ManagePasswordsDecorationStateTest,
::testing::ValuesIn(managerActiveOnPageAndPendingTests));
INSTANTIATE_TEST_CASE_P(,
ManagePasswordsDecorationStateTest,
::testing::ValuesIn(testCases));
4 changes: 0 additions & 4 deletions chrome/browser/ui/cocoa/passwords/OWNERS

This file was deleted.

32 changes: 0 additions & 32 deletions chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.h

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e1b73f4

Please sign in to comment.