2752406: [LSC] Replace base::string16 with std::u16string in //ui
2752406
This commit is contained in:
parent
d4bec23bde
commit
9e336f5d0c
8 changed files with 15 additions and 15 deletions
|
@ -78,7 +78,7 @@ void MenuBar::SetAcceleratorVisibility(bool visible) {
|
||||||
static_cast<SubmenuButton*>(child)->SetAcceleratorVisibility(visible);
|
static_cast<SubmenuButton*>(child)->SetAcceleratorVisibility(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuBar::View* MenuBar::FindAccelChild(base::char16 key) {
|
MenuBar::View* MenuBar::FindAccelChild(char16_t key) {
|
||||||
for (auto* child : GetChildrenInZOrder()) {
|
for (auto* child : GetChildrenInZOrder()) {
|
||||||
if (static_cast<SubmenuButton*>(child)->accelerator() == key)
|
if (static_cast<SubmenuButton*>(child)->accelerator() == key)
|
||||||
return child;
|
return child;
|
||||||
|
@ -86,11 +86,11 @@ MenuBar::View* MenuBar::FindAccelChild(base::char16 key) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MenuBar::HasAccelerator(base::char16 key) {
|
bool MenuBar::HasAccelerator(char16_t key) {
|
||||||
return FindAccelChild(key) != nullptr;
|
return FindAccelChild(key) != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::ActivateAccelerator(base::char16 key) {
|
void MenuBar::ActivateAccelerator(char16_t key) {
|
||||||
auto* child = FindAccelChild(key);
|
auto* child = FindAccelChild(key);
|
||||||
if (child)
|
if (child)
|
||||||
static_cast<SubmenuButton*>(child)->Activate(nullptr);
|
static_cast<SubmenuButton*>(child)->Activate(nullptr);
|
||||||
|
|
|
@ -51,10 +51,10 @@ class MenuBar : public views::AccessiblePaneView,
|
||||||
void SetAcceleratorVisibility(bool visible);
|
void SetAcceleratorVisibility(bool visible);
|
||||||
|
|
||||||
// Returns true if the submenu has accelerator |key|
|
// Returns true if the submenu has accelerator |key|
|
||||||
bool HasAccelerator(base::char16 key);
|
bool HasAccelerator(char16_t key);
|
||||||
|
|
||||||
// Shows the submenu whose accelerator is |key|.
|
// Shows the submenu whose accelerator is |key|.
|
||||||
void ActivateAccelerator(base::char16 key);
|
void ActivateAccelerator(char16_t key);
|
||||||
|
|
||||||
// Returns there are how many items in the root menu.
|
// Returns there are how many items in the root menu.
|
||||||
int GetItemCount() const;
|
int GetItemCount() const;
|
||||||
|
@ -95,7 +95,7 @@ class MenuBar : public views::AccessiblePaneView,
|
||||||
RootView* window_ = nullptr;
|
RootView* window_ = nullptr;
|
||||||
ElectronMenuModel* menu_model_ = nullptr;
|
ElectronMenuModel* menu_model_ = nullptr;
|
||||||
|
|
||||||
View* FindAccelChild(base::char16 key);
|
View* FindAccelChild(char16_t key);
|
||||||
|
|
||||||
bool has_focus_ = true;
|
bool has_focus_ = true;
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ void SubmenuButton::PaintButtonContents(gfx::Canvas* canvas) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SubmenuButton::GetUnderlinePosition(const base::string16& text,
|
bool SubmenuButton::GetUnderlinePosition(const base::string16& text,
|
||||||
base::char16* accelerator,
|
char16_t* accelerator,
|
||||||
int* start,
|
int* start,
|
||||||
int* end) const {
|
int* end) const {
|
||||||
int pos, span;
|
int pos, span;
|
||||||
|
|
|
@ -24,7 +24,7 @@ class SubmenuButton : public views::MenuButton {
|
||||||
void SetAcceleratorVisibility(bool visible);
|
void SetAcceleratorVisibility(bool visible);
|
||||||
void SetUnderlineColor(SkColor color);
|
void SetUnderlineColor(SkColor color);
|
||||||
|
|
||||||
base::char16 accelerator() const { return accelerator_; }
|
char16_t accelerator() const { return accelerator_; }
|
||||||
|
|
||||||
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
|
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
|
||||||
|
|
||||||
|
@ -37,14 +37,14 @@ class SubmenuButton : public views::MenuButton {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool GetUnderlinePosition(const base::string16& text,
|
bool GetUnderlinePosition(const base::string16& text,
|
||||||
base::char16* accelerator,
|
char16_t* accelerator,
|
||||||
int* start,
|
int* start,
|
||||||
int* end) const;
|
int* end) const;
|
||||||
void GetCharacterPosition(const base::string16& text,
|
void GetCharacterPosition(const base::string16& text,
|
||||||
int index,
|
int index,
|
||||||
int* pos) const;
|
int* pos) const;
|
||||||
|
|
||||||
base::char16 accelerator_ = 0;
|
char16_t accelerator_ = 0;
|
||||||
|
|
||||||
bool show_underline_ = false;
|
bool show_underline_ = false;
|
||||||
|
|
||||||
|
|
|
@ -44,10 +44,10 @@ int VectorToBitArray(const std::vector<T>& vec) {
|
||||||
namespace gin {
|
namespace gin {
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct Converter<base::char16> {
|
struct Converter<char16_t> {
|
||||||
static bool FromV8(v8::Isolate* isolate,
|
static bool FromV8(v8::Isolate* isolate,
|
||||||
v8::Handle<v8::Value> val,
|
v8::Handle<v8::Value> val,
|
||||||
base::char16* out) {
|
char16_t* out) {
|
||||||
base::string16 code = base::UTF8ToUTF16(gin::V8ToString(isolate, val));
|
base::string16 code = base::UTF8ToUTF16(gin::V8ToString(isolate, val));
|
||||||
if (code.length() != 1)
|
if (code.length() != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -138,7 +138,7 @@ ui::KeyboardCode KeyboardCodeFromKeyIdentifier(const std::string& s,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted) {
|
ui::KeyboardCode KeyboardCodeFromCharCode(char16_t c, bool* shifted) {
|
||||||
c = base::ToLowerASCII(c);
|
c = base::ToLowerASCII(c);
|
||||||
*shifted = false;
|
*shifted = false;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace electron {
|
||||||
|
|
||||||
// Return key code of the char, and also determine whether the SHIFT key is
|
// Return key code of the char, and also determine whether the SHIFT key is
|
||||||
// pressed.
|
// pressed.
|
||||||
ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted);
|
ui::KeyboardCode KeyboardCodeFromCharCode(char16_t c, bool* shifted);
|
||||||
|
|
||||||
// Return key code of the |str|, and also determine whether the SHIFT key is
|
// Return key code of the |str|, and also determine whether the SHIFT key is
|
||||||
// pressed.
|
// pressed.
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace api {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
bool HasWordCharacters(const base::string16& text, int index) {
|
bool HasWordCharacters(const base::string16& text, int index) {
|
||||||
const base::char16* data = text.data();
|
const char16_t* data = text.data();
|
||||||
int length = text.length();
|
int length = text.length();
|
||||||
while (index < length) {
|
while (index < length) {
|
||||||
uint32_t code = 0;
|
uint32_t code = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue