CmdScatterMenuModel::CmdScatterMenuModel(CmdScatterMenuButton* button) 
	: ui::SimpleMenuModel(this)
	, button_(button)
{
	AddRadioItem(WindowInterface::CMD_DEFAULT,
		WideToUTF16(L"not sharing input(default)"), kGroupMakeDecision);
	AddRadioItem(WindowInterface::CMD_TO_ACTIVE_TAB,
		WideToUTF16(L"sharing input to the active tabs only"), kGroupMakeDecision);
	AddRadioItem(WindowInterface::CMD_TO_WITHIN_WINDOW,
		WideToUTF16(L"sharing input to all tabs within current window only"), kGroupMakeDecision);
	AddRadioItem(WindowInterface::CMD_TO_ALL,
		WideToUTF16(L"sharing input to all tabs among all windows"), kGroupMakeDecision);
	menu_.reset(new view::Menu2(this));
}
 string16 NativeTextfieldWin::GetText() const
 {
     int len = GetTextLength() + 1;
     std::wstring str;
     GetWindowText(WriteInto(&str, len), len);
     // The text get from GetWindowText() might be wrapped with explicit bidi
     // control characters. Refer to UpdateText() for detail. Without such
     // wrapping, in RTL chrome, a pure LTR string ending with parenthesis will
     // not be displayed correctly in a textfield. For example, "Yahoo!" will be
     // displayed as "!Yahoo", and "Google (by default)" will be displayed as
     // "(Google (by default".
     return base::i18n::StripWrappingBidiControlCharacters(WideToUTF16(str));
 }
示例#3
0
文件: WebView.cpp 项目: dbabox/aomi
void Awesomium::WebView::injectTextEvent(std::wstring text)
{
	// Webkit uses utf-16...
	string16 output = WideToUTF16(text);
	coreThread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(viewProxy, &WebViewProxy::injectTextEvent, output));
}