diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 13:07:32 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 13:07:32 +0000 |
commit | 27d2fb739bd5eed3696d6226a27ad2cb00074eb4 (patch) | |
tree | 5851b5d3b202792a9a7c9baff09b4727601e8de0 /chrome | |
parent | 67c7586a9ac51157d30668c3986be13924d916b5 (diff) | |
download | chromium_src-27d2fb739bd5eed3696d6226a27ad2cb00074eb4.zip chromium_src-27d2fb739bd5eed3696d6226a27ad2cb00074eb4.tar.gz chromium_src-27d2fb739bd5eed3696d6226a27ad2cb00074eb4.tar.bz2 |
Don't crash on a right-aligned link in a LinkInfoBarDelegate.
TEST=LinkInfoBarControllerTest.*
BUG=47728
Review URL: http://codereview.chromium.org/2842031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/infobar_controller.mm | 6 | ||||
-rw-r--r-- | chrome/browser/cocoa/infobar_test_helper.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/infobar_controller.mm b/chrome/browser/cocoa/infobar_controller.mm index c6f42a4..c73511d 100644 --- a/chrome/browser/cocoa/infobar_controller.mm +++ b/chrome/browser/cocoa/infobar_controller.mm @@ -281,6 +281,12 @@ const float kAnimateCloseDuration = 0.12; - (void)setLabelToMessage:(NSString*)message withLink:(NSString*)link atOffset:(NSUInteger)linkOffset { + if (linkOffset == std::wstring::npos) { + // linkOffset == std::wstring::npos means the link should be right-aligned, + // which is not supported on Mac (http://crbug.com/47728). + NOTIMPLEMENTED(); + linkOffset = [message length]; + } // Create an attributes dictionary for the entire message. We have // to expicitly set the font the control's font. We also override // the cursor to give us the normal cursor rather than the text diff --git a/chrome/browser/cocoa/infobar_test_helper.h b/chrome/browser/cocoa/infobar_test_helper.h index 7c7b84c..d83bdc1 100644 --- a/chrome/browser/cocoa/infobar_test_helper.h +++ b/chrome/browser/cocoa/infobar_test_helper.h @@ -57,7 +57,6 @@ class MockLinkInfoBarDelegate : public LinkInfoBarDelegate { virtual std::wstring GetMessageTextWithOffset(size_t* link_offset) const { message_text_accessed = true; - *link_offset = 1; return kMockLinkInfoBarMessage; } |