Skip to content

Commit 26e9b71

Browse files
committed
osx fix for M41 beta
1 parent 531dc98 commit 26e9b71

File tree

5 files changed

+16
-18
lines changed

5 files changed

+16
-18
lines changed

src/browser/app_controller_mac.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ @implementation AppController
3434
- (BOOL)application:(NSApplication*)sender
3535
openFile:(NSString*)filename {
3636
if (content::Shell::windows().size() == 0) {
37-
CommandLine::ForCurrentProcess()->AppendArg([filename UTF8String]);
38-
CommandLine::ForCurrentProcess()->FixOrigArgv4Finder([filename UTF8String]);
37+
base::CommandLine::ForCurrentProcess()->AppendArg([filename UTF8String]);
38+
base::CommandLine::ForCurrentProcess()->FixOrigArgv4Finder([filename UTF8String]);
3939
return TRUE;
4040
}
4141

src/browser/autofill_popup_view_bridge.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
1111
#include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h"
1212
#import "chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.h"
13-
#include "ui/gfx/rect.h"
1413

1514
namespace autofill {
1615

src/browser/autofill_popup_view_cocoa.mm

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
#include "chrome/browser/ui/autofill/popup_constants.h"
1111
#include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h"
1212
#include "components/autofill/core/browser/popup_item_ids.h"
13+
#include "components/autofill/core/browser/suggestion.h"
1314
#include "ui/base/cocoa/window_size_constants.h"
1415
#include "ui/base/resource/resource_bundle.h"
1516
#include "ui/gfx/font_list.h"
1617
#include "ui/gfx/image/image.h"
17-
#include "ui/gfx/point.h"
18-
#include "ui/gfx/rect.h"
1918

2019
using autofill::AutofillPopupView;
2120

@@ -97,31 +96,31 @@ - (void)drawRect:(NSRect)dirtyRect {
9796

9897
[self drawBackgroundAndBorder];
9998

100-
for (size_t i = 0; i < controller_->names().size(); ++i) {
99+
for (size_t i = 0; i < controller_->GetLineCount(); ++i) {
101100
// Skip rows outside of the dirty rect.
102101
NSRect rowBounds =
103102
NSRectFromCGRect(controller_->GetRowBounds(i).ToCGRect());
104103
if (!NSIntersectsRect(rowBounds, dirtyRect))
105104
continue;
106105

107-
if (controller_->identifiers()[i] == autofill::POPUP_ITEM_ID_SEPARATOR) {
106+
if (controller_->GetSuggestionAt(i).frontend_id == autofill::POPUP_ITEM_ID_SEPARATOR) {
108107
[self drawSeparatorWithBounds:rowBounds];
109108
continue;
110109
}
111110

112111
// Additional offset applied to the text in the vertical direction.
113112
CGFloat textYOffset = 0;
114113
BOOL imageFirst = NO;
115-
if (controller_->identifiers()[i] ==
114+
if (controller_->GetSuggestionAt(i).frontend_id ==
116115
autofill::POPUP_ITEM_ID_MAC_ACCESS_CONTACTS) {
117116
// Due to the weighting of the asset used for this autofill entry, the
118117
// text needs to be bumped up by 1 pt to make it look vertically aligned.
119118
textYOffset = -1;
120119
imageFirst = YES;
121120
}
122121

123-
NSString* name = SysUTF16ToNSString(controller_->names()[i]);
124-
NSString* subtext = SysUTF16ToNSString(controller_->subtexts()[i]);
122+
NSString* name = SysUTF16ToNSString(controller_->GetElidedValueAt(i));
123+
NSString* subtext = SysUTF16ToNSString(controller_->GetElidedLabelAt(i));
125124
BOOL isSelected = static_cast<int>(i) == controller_->selected_line();
126125
[self drawSuggestionWithName:name
127126
subtext:subtext
@@ -203,7 +202,7 @@ - (CGFloat)drawName:(NSString*)name
203202
controller_->IsWarning(index) ? [self warningColor] : [self nameColor];
204203
NSDictionary* nameAttributes =
205204
[NSDictionary dictionaryWithObjectsAndKeys:
206-
controller_->GetNameFontListForRow(index).GetPrimaryFont().
205+
controller_->GetValueFontListForRow(index).GetPrimaryFont().
207206
GetNativeFont(),
208207
NSFontAttributeName, nameColor, NSForegroundColorAttributeName,
209208
nil];
@@ -247,7 +246,7 @@ - (CGFloat)drawSubtext:(NSString*)subtext
247246
textYOffset:(CGFloat)textYOffset {
248247
NSDictionary* subtextAttributes =
249248
[NSDictionary dictionaryWithObjectsAndKeys:
250-
controller_->subtext_font_list().GetPrimaryFont().GetNativeFont(),
249+
controller_->GetLabelFontList().GetPrimaryFont().GetNativeFont(),
251250
NSFontAttributeName,
252251
[self subtextColor],
253252
NSForegroundColorAttributeName,
@@ -263,10 +262,10 @@ - (CGFloat)drawSubtext:(NSString*)subtext
263262
}
264263

265264
- (NSImage*)iconAtIndex:(size_t)index {
266-
if (controller_->icons()[index].empty())
265+
if (controller_->GetSuggestionAt(index).icon.empty())
267266
return nil;
268267

269-
int iconId = controller_->GetIconResourceID(controller_->icons()[index]);
268+
int iconId = controller_->GetIconResourceID(controller_->GetSuggestionAt(index).icon);
270269
DCHECK_NE(-1, iconId);
271270

272271
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();

src/browser/native_window.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ class CapturePageHelper;
6666

6767
#if defined(OS_WIN) || defined(OS_LINUX)
6868
class NativeWindow : public web_modal::WebContentsModalDialogHost {
69+
public:
70+
~NativeWindow() override;
6971
#else
7072
class NativeWindow {
73+
public:
74+
virtual ~NativeWindow();
7175
#endif
72-
public:
73-
~NativeWindow() override;
7476

7577
static NativeWindow* Create(const base::WeakPtr<content::Shell>& shell,
7678
base::DictionaryValue* manifest);

src/browser/native_window_mac.mm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,6 @@ - (void)drawRect:(NSRect)dirtyRect {
495495
void NativeWindowCocoa::Show() {
496496
NSApplication *myApp = [NSApplication sharedApplication];
497497
[myApp activateIgnoringOtherApps:NO];
498-
content::RenderWidgetHostView* rwhv =
499-
shell_->web_contents()->GetRenderWidgetHostView();
500498

501499
if (first_show_ && initial_focus_) {
502500
[window() makeKeyAndOrderFront:nil];

0 commit comments

Comments
 (0)