Fix API changes of base::Value

This commit is contained in:
Cheng Zhao 2017-04-05 17:34:53 +09:00
parent 9d1b88ed59
commit 50e3bfa764
21 changed files with 55 additions and 55 deletions

View file

@ -73,7 +73,7 @@ void GenerateAcceleratorTable(AcceleratorTable* table,
int count = model->GetItemCount();
for (int i = 0; i < count; ++i) {
atom::AtomMenuModel::ItemType type = model->GetTypeAt(i);
if (type == atom::AtomMenuModel::TYPE_SUBMENU) {
if (type == atom::AtomMenuModel::Type::SUBMENU) {
auto submodel = model->GetSubmenuModelAt(i);
GenerateAcceleratorTable(table, submodel);
} else {

View file

@ -87,7 +87,7 @@ Role kRolesMap[] = {
const int count = model->GetItemCount();
for (int index = 0; index < count; index++) {
if (model->GetTypeAt(index) == atom::AtomMenuModel::TYPE_SEPARATOR)
if (model->GetTypeAt(index) == atom::AtomMenuModel::Type::SEPARATOR)
[self addSeparatorToMenu:menu_ atIndex:index];
else
[self addItemToMenu:menu_ atIndex:index fromModel:model];
@ -109,7 +109,7 @@ Role kRolesMap[] = {
const int count = model->GetItemCount();
for (int index = 0; index < count; index++) {
if (model->GetTypeAt(index) == atom::AtomMenuModel::TYPE_SEPARATOR)
if (model->GetTypeAt(index) == atom::AtomMenuModel::Type::SEPARATOR)
[self addSeparatorToMenu:menu atIndex:index];
else
[self addItemToMenu:menu atIndex:index fromModel:model];
@ -145,7 +145,7 @@ Role kRolesMap[] = {
[item setImage:icon.ToNSImage()];
atom::AtomMenuModel::ItemType type = model->GetTypeAt(index);
if (type == atom::AtomMenuModel::TYPE_SUBMENU) {
if (type == atom::AtomMenuModel::Type::SUBMENU) {
// Recursively build a submenu from the sub-model at this index.
[item setTarget:nil];
[item setAction:nil];

View file

@ -225,7 +225,7 @@ void GlobalMenuBarX11::BuildMenuFromModel(AtomMenuModel* model,
menuitem_property_set_bool(item, kPropertyVisible, model->IsVisibleAt(i));
AtomMenuModel::ItemType type = model->GetTypeAt(i);
if (type == AtomMenuModel::TYPE_SEPARATOR) {
if (type == AtomMenuModel::Type::SEPARATOR) {
menuitem_property_set(item, kPropertyType, kTypeSeparator);
} else {
std::string label = ui::ConvertAcceleratorsFromWindowsStyle(
@ -236,7 +236,7 @@ void GlobalMenuBarX11::BuildMenuFromModel(AtomMenuModel* model,
g_object_set_data(G_OBJECT(item), "model", model);
SetMenuItemID(item, i);
if (type == AtomMenuModel::TYPE_SUBMENU) {
if (type == AtomMenuModel::Type::SUBMENU) {
menuitem_property_set(item, kPropertyChildrenDisplay, kDisplaySubmenu);
g_signal_connect(item, "about-to-show",
G_CALLBACK(OnSubMenuShowThunk), this);
@ -248,10 +248,10 @@ void GlobalMenuBarX11::BuildMenuFromModel(AtomMenuModel* model,
g_signal_connect(item, "item-activated",
G_CALLBACK(OnItemActivatedThunk), this);
if (type == AtomMenuModel::TYPE_CHECK ||
type == AtomMenuModel::TYPE_RADIO) {
if (type == AtomMenuModel::Type::CHECK ||
type == AtomMenuModel::Type::RADIO) {
menuitem_property_set(item, kPropertyToggleType,
type == AtomMenuModel::TYPE_CHECK ? kToggleCheck : kToggleRadio);
type == AtomMenuModel::Type::CHECK ? kToggleCheck : kToggleRadio);
menuitem_property_set_int(item, kPropertyToggleState,
model->IsItemCheckedAt(i));
}

View file

@ -120,7 +120,7 @@ bool MenuBar::GetMenuButtonFromScreenPoint(const gfx::Point& point,
for (int i = 0; i < child_count(); ++i) {
views::View* view = child_at(i);
if (view->bounds().Contains(location) &&
(menu_model_->GetTypeAt(i) == AtomMenuModel::TYPE_SUBMENU)) {
(menu_model_->GetTypeAt(i) == AtomMenuModel::Type::SUBMENU)) {
*menu_model = menu_model_->GetSubmenuModelAt(i);
*button = static_cast<views::MenuButton*>(view);
return true;
@ -148,7 +148,7 @@ void MenuBar::OnMenuButtonClicked(views::MenuButton* source,
int id = source->tag();
AtomMenuModel::ItemType type = menu_model_->GetTypeAt(id);
if (type != AtomMenuModel::TYPE_SUBMENU) {
if (type != AtomMenuModel::Type::SUBMENU) {
menu_model_->ActivatedAt(id, 0);
return;
}

View file

@ -131,7 +131,7 @@ void PdfViewerHandler::GetDefaultZoom(const base::ListValue* args) {
double zoom_level = host_zoom_map->GetDefaultZoomLevel();
ResolveJavascriptCallback(
*callback_id,
base::FundamentalValue(content::ZoomLevelToZoomFactor(zoom_level)));
base::Value(content::ZoomLevelToZoomFactor(zoom_level)));
}
void PdfViewerHandler::GetInitialZoom(const base::ListValue* args) {
@ -145,7 +145,7 @@ void PdfViewerHandler::GetInitialZoom(const base::ListValue* args) {
content::HostZoomMap::GetZoomLevel(web_ui()->GetWebContents());
ResolveJavascriptCallback(
*callback_id,
base::FundamentalValue(content::ZoomLevelToZoomFactor(zoom_level)));
base::Value(content::ZoomLevelToZoomFactor(zoom_level)));
}
void PdfViewerHandler::SetZoom(const base::ListValue* args) {
@ -159,7 +159,7 @@ void PdfViewerHandler::SetZoom(const base::ListValue* args) {
content::HostZoomMap::SetZoomLevel(web_ui()->GetWebContents(),
zoom_level);
ResolveJavascriptCallback(*callback_id, base::FundamentalValue(zoom_level));
ResolveJavascriptCallback(*callback_id, base::Value(zoom_level));
}
void PdfViewerHandler::GetStrings(const base::ListValue* args) {
@ -204,7 +204,7 @@ void PdfViewerHandler::OnZoomLevelChanged(
if (change.host == kPdfViewerUIHost) {
CallJavascriptFunction(
"cr.webUIListenerCallback", base::StringValue("onZoomLevelChanged"),
base::FundamentalValue(
base::Value(
content::ZoomLevelToZoomFactor(change.zoom_level)));
}
}