summaryrefslogtreecommitdiff
path: root/chromium/ui/base/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/base/cocoa')
-rw-r--r--chromium/ui/base/cocoa/DIR_METADATA11
-rw-r--r--chromium/ui/base/cocoa/animation_utils.h6
-rw-r--r--chromium/ui/base/cocoa/appkit_utils.h6
-rw-r--r--chromium/ui/base/cocoa/defaults_utils.h2
-rw-r--r--chromium/ui/base/cocoa/focus_window_set.h33
-rw-r--r--chromium/ui/base/cocoa/focus_window_set.mm92
-rw-r--r--chromium/ui/base/cocoa/menu_controller.h1
-rw-r--r--chromium/ui/base/cocoa/secure_password_input.mm2
-rw-r--r--chromium/ui/base/cocoa/touch_bar_util.h6
9 files changed, 11 insertions, 148 deletions
diff --git a/chromium/ui/base/cocoa/DIR_METADATA b/chromium/ui/base/cocoa/DIR_METADATA
deleted file mode 100644
index 2769d07edc7..00000000000
--- a/chromium/ui/base/cocoa/DIR_METADATA
+++ /dev/null
@@ -1,11 +0,0 @@
-# Metadata information for this directory.
-#
-# For more information on DIR_METADATA files, see:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
-#
-# For the schema of this file, see Metadata message:
-# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
-
-monorail {
- component: "UI"
-} \ No newline at end of file
diff --git a/chromium/ui/base/cocoa/animation_utils.h b/chromium/ui/base/cocoa/animation_utils.h
index 89e8fff8e02..2e08ce609c8 100644
--- a/chromium/ui/base/cocoa/animation_utils.h
+++ b/chromium/ui/base/cocoa/animation_utils.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_BASE_COCOA_ANIMATION_UTILS_H
-#define UI_BASE_COCOA_ANIMATION_UTILS_H
+#ifndef UI_BASE_COCOA_ANIMATION_UTILS_H_
+#define UI_BASE_COCOA_ANIMATION_UTILS_H_
#import <Cocoa/Cocoa.h>
#import <QuartzCore/QuartzCore.h>
@@ -59,4 +59,4 @@ class ScopedCAActionSetDuration {
}
};
-#endif // UI_BASE_COCOA_ANIMATION_UTILS_H
+#endif // UI_BASE_COCOA_ANIMATION_UTILS_H_
diff --git a/chromium/ui/base/cocoa/appkit_utils.h b/chromium/ui/base/cocoa/appkit_utils.h
index a3b46d13329..6d28aeedba4 100644
--- a/chromium/ui/base/cocoa/appkit_utils.h
+++ b/chromium/ui/base/cocoa/appkit_utils.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_BASE_COCOA_APPKIT_UTILS_H
-#define UI_BASE_COCOA_APPKIT_UTILS_H
+#ifndef UI_BASE_COCOA_APPKIT_UTILS_H_
+#define UI_BASE_COCOA_APPKIT_UTILS_H_
#import <Cocoa/Cocoa.h>
@@ -19,4 +19,4 @@ COMPONENT_EXPORT(UI_BASE) bool IsCGFloatEqual(CGFloat a, CGFloat b);
} // namespace ui
-#endif // UI_BASE_COCOA_APPKIT_UTILS_H
+#endif // UI_BASE_COCOA_APPKIT_UTILS_H_
diff --git a/chromium/ui/base/cocoa/defaults_utils.h b/chromium/ui/base/cocoa/defaults_utils.h
index 7845045d5c4..0c2e078c3c0 100644
--- a/chromium/ui/base/cocoa/defaults_utils.h
+++ b/chromium/ui/base/cocoa/defaults_utils.h
@@ -16,4 +16,4 @@ COMPONENT_EXPORT(UI_BASE)
bool TextInsertionCaretBlinkPeriod(base::TimeDelta* period);
}
-#endif
+#endif // UI_BASE_COCOA_DEFAULTS_UTILS_H_
diff --git a/chromium/ui/base/cocoa/focus_window_set.h b/chromium/ui/base/cocoa/focus_window_set.h
deleted file mode 100644
index 820195f6978..00000000000
--- a/chromium/ui/base/cocoa/focus_window_set.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_BASE_COCOA_FOCUS_WINDOW_SET_H_
-#define UI_BASE_COCOA_FOCUS_WINDOW_SET_H_
-
-#include <set>
-
-#include "base/component_export.h"
-#include "ui/gfx/native_widget_types.h"
-
-namespace ui {
-
-// Brings a group of windows to the front without changing their order, and
-// makes the frontmost one key and main. If none are visible, the frontmost
-// miniaturized window is deminiaturized.
-COMPONENT_EXPORT(UI_BASE)
-void FocusWindowSet(const std::set<gfx::NativeWindow>& windows);
-
-// Brings a group of windows to the front without changing their
-// order, and makes the frontmost one key and main. If none are
-// visible, the frontmost miniaturized window is deminiaturized. This
-// variant is meant to clean up after the system-default Dock icon
-// behavior. Unlike FocusWindowSet, only windows on the current space
-// are considered. It also ignores the hidden state of windows; the
-// window system may be in the middle of unhiding the application.
-COMPONENT_EXPORT(UI_BASE)
-void FocusWindowSetOnCurrentSpace(const std::set<gfx::NativeWindow>& windows);
-
-} // namespace ui
-
-#endif // UI_BASE_COCOA_FOCUS_WINDOW_SET_H_
diff --git a/chromium/ui/base/cocoa/focus_window_set.mm b/chromium/ui/base/cocoa/focus_window_set.mm
deleted file mode 100644
index 06e7223ded8..00000000000
--- a/chromium/ui/base/cocoa/focus_window_set.mm
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import <Cocoa/Cocoa.h>
-
-#include "base/check.h"
-#include "ui/base/cocoa/focus_window_set.h"
-
-namespace ui {
-
-namespace {
-
-// This attempts to match OS X's native behavior, namely that a window
-// is only ever deminiaturized if ALL windows on ALL workspaces are
-// miniaturized.
-void FocusWindowSetHelper(const std::set<gfx::NativeWindow>& windows,
- bool allow_workspace_switch,
- bool visible_windows_only) {
- NSArray* ordered_windows = [NSApp orderedWindows];
- NSWindow* frontmost_window = nil;
- NSWindow* frontmost_window_all_spaces = nil;
- NSWindow* frontmost_miniaturized_window = nil;
- bool all_miniaturized = true;
- for (int i = [ordered_windows count] - 1; i >= 0; i--) {
- NSWindow* win = ordered_windows[i];
- if (windows.find(win) == windows.end())
- continue;
- if ([win isMiniaturized]) {
- frontmost_miniaturized_window = win;
- } else if (!visible_windows_only || [win isVisible]) {
- all_miniaturized = false;
- frontmost_window_all_spaces = win;
- if ([win isOnActiveSpace]) {
- // Raise the old |frontmost_window| (if any). The topmost |win| will be
- // raised with makeKeyAndOrderFront: below.
- [frontmost_window orderFront:nil];
- frontmost_window = win;
- }
- }
- }
- if (all_miniaturized && frontmost_miniaturized_window) {
- DCHECK(!frontmost_window);
- // Note the call to makeKeyAndOrderFront: will deminiaturize the window.
- frontmost_window = frontmost_miniaturized_window;
- }
- // If we couldn't find one on the active space, consider all spaces.
- if (allow_workspace_switch && !frontmost_window)
- frontmost_window = frontmost_window_all_spaces;
-
- if (frontmost_window) {
- [frontmost_window makeKeyAndOrderFront:nil];
- [NSApp activateIgnoringOtherApps:YES];
- }
-}
-
-} // namespace
-
-void FocusWindowSet(const std::set<gfx::NativeWindow>& windows) {
- FocusWindowSetHelper(windows, true, true);
-}
-
-void FocusWindowSetOnCurrentSpace(const std::set<gfx::NativeWindow>& windows) {
- // This callback runs before AppKit picks its own window to
- // deminiaturize, so we get to pick one from the right set. Limit to
- // the windows on the current workspace. Otherwise we jump spaces
- // haphazardly.
- //
- // Also consider both visible and hidden windows; this call races
- // with the system unhiding the application. http://crbug.com/368238
- //
- // NOTE: If this is called in the
- // applicationShouldHandleReopen:hasVisibleWindows: hook when
- // clicking the dock icon, and that caused OS X to begin switch
- // spaces, isOnActiveSpace gives the answer for the PREVIOUS
- // space. This means that we actually raise and focus the wrong
- // space's windows, leaving the new key window off-screen. To detect
- // this, check if the key window is on the active space prior to
- // calling.
- //
- // Also, if we decide to deminiaturize a window during a space switch,
- // that can switch spaces and then switch back. Fortunately, this only
- // happens if, say, space 1 contains an app, space 2 contains a
- // miniaturized browser. We click the icon, OS X switches to space 1,
- // we deminiaturize the browser, and that triggers switching back.
- //
- // TODO(davidben): To limit those cases, consider preferentially
- // deminiaturizing a window on the current space.
- FocusWindowSetHelper(windows, false, false);
-}
-
-} // namespace ui
diff --git a/chromium/ui/base/cocoa/menu_controller.h b/chromium/ui/base/cocoa/menu_controller.h
index ace28e03577..5a42c79cc5a 100644
--- a/chromium/ui/base/cocoa/menu_controller.h
+++ b/chromium/ui/base/cocoa/menu_controller.h
@@ -7,7 +7,6 @@
#import <Cocoa/Cocoa.h>
-#include <string>
#include "base/component_export.h"
#include "base/mac/scoped_nsobject.h"
diff --git a/chromium/ui/base/cocoa/secure_password_input.mm b/chromium/ui/base/cocoa/secure_password_input.mm
index c9d003216ec..b3283a4c85e 100644
--- a/chromium/ui/base/cocoa/secure_password_input.mm
+++ b/chromium/ui/base/cocoa/secure_password_input.mm
@@ -41,7 +41,7 @@ void SetPasswordInputEnabled(bool enabled) {
namespace ui {
ScopedPasswordInputEnabler::ScopedPasswordInputEnabler() {
- if (!g_password_input_counter) {
+ if (!g_password_input_counter && !IsSecureEventInputEnabled()) {
SetPasswordInputEnabled(true);
}
++g_password_input_counter;
diff --git a/chromium/ui/base/cocoa/touch_bar_util.h b/chromium/ui/base/cocoa/touch_bar_util.h
index 19293c6f93a..965f50cc119 100644
--- a/chromium/ui/base/cocoa/touch_bar_util.h
+++ b/chromium/ui/base/cocoa/touch_bar_util.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_BASE_COCOA_TOUCH_BAR_UTIL_H
-#define UI_BASE_COCOA_TOUCH_BAR_UTIL_H
+#ifndef UI_BASE_COCOA_TOUCH_BAR_UTIL_H_
+#define UI_BASE_COCOA_TOUCH_BAR_UTIL_H_
#import <Cocoa/Cocoa.h>
#include <os/availability.h>
@@ -40,4 +40,4 @@ NSString* GetTouchBarItemId(NSString* touch_bar_id, NSString* item_id);
} // namespace ui
-#endif // UI_BASE_COCOA_TOUCH_BAR_UTIL_H
+#endif // UI_BASE_COCOA_TOUCH_BAR_UTIL_H_