Make EnabledInRichlyEditableText return false for user-triggered command and unfocused selection

Certain editing commands shouldn't be enabled when they are user-triggered and
the selection doesn't have focus. This patch adds checking of
FrameSelection::SelectionHasFocus() in EnabledInRichlyEditableText to fix
the behavior of these commands:

AlignJustified
AlignLeft
AlignRight
BackColor
Bold
CreateLink
FontName
FontSize
FontSizeDelta
ForeColor
FormatBlock
HiliteColor
Indent
InsertHorizontalRule
InsertImage
InsertNewlineInQuotedContent
InsertOrderedList
InsertUnorderedList
Italic
JustifyCenter
JustifyFull
JustifyLeft
JustifyNone
JustifyRight
MakeTextWritingDirectionLeftToRight
MakeTextWritingDirectionNatural
MakeTextWritingDirectionRightToLeft
Outdent
OverWrite
Strikethrough
Subscript
Superscript
ToggleBold
ToggleItalic
ToggleUnderline
Underline
Unscript
AlignCenter

BUG=722925
TEST=editing/style/apply_style_with_unfocused_selection.html

Review-Url: https://codereview.chromium.org/2883383003
Cr-Commit-Position: refs/heads/master@{#472335}
2 files changed