Fix API changes of base::Value
This commit is contained in:
parent
9d1b88ed59
commit
50e3bfa764
21 changed files with 55 additions and 55 deletions
|
@ -877,7 +877,7 @@ void WebContents::DevToolsOpened() {
|
|||
devtools_web_contents_.Reset(isolate(), handle.ToV8());
|
||||
|
||||
// Set inspected tabID.
|
||||
base::FundamentalValue tab_id(ID());
|
||||
base::Value tab_id(ID());
|
||||
managed_web_contents()->CallClientFunction(
|
||||
"DevToolsAPI.setInspectedTabId", &tab_id, nullptr, nullptr);
|
||||
|
||||
|
|
|
@ -489,9 +489,9 @@ void CommonWebContentsDelegate::OnDevToolsIndexingWorkCalculated(
|
|||
int request_id,
|
||||
const std::string& file_system_path,
|
||||
int total_work) {
|
||||
base::FundamentalValue request_id_value(request_id);
|
||||
base::Value request_id_value(request_id);
|
||||
base::StringValue file_system_path_value(file_system_path);
|
||||
base::FundamentalValue total_work_value(total_work);
|
||||
base::Value total_work_value(total_work);
|
||||
web_contents_->CallClientFunction("DevToolsAPI.indexingTotalWorkCalculated",
|
||||
&request_id_value,
|
||||
&file_system_path_value,
|
||||
|
@ -502,9 +502,9 @@ void CommonWebContentsDelegate::OnDevToolsIndexingWorked(
|
|||
int request_id,
|
||||
const std::string& file_system_path,
|
||||
int worked) {
|
||||
base::FundamentalValue request_id_value(request_id);
|
||||
base::Value request_id_value(request_id);
|
||||
base::StringValue file_system_path_value(file_system_path);
|
||||
base::FundamentalValue worked_value(worked);
|
||||
base::Value worked_value(worked);
|
||||
web_contents_->CallClientFunction("DevToolsAPI.indexingWorked",
|
||||
&request_id_value,
|
||||
&file_system_path_value,
|
||||
|
@ -515,7 +515,7 @@ void CommonWebContentsDelegate::OnDevToolsIndexingDone(
|
|||
int request_id,
|
||||
const std::string& file_system_path) {
|
||||
devtools_indexing_jobs_.erase(request_id);
|
||||
base::FundamentalValue request_id_value(request_id);
|
||||
base::Value request_id_value(request_id);
|
||||
base::StringValue file_system_path_value(file_system_path);
|
||||
web_contents_->CallClientFunction("DevToolsAPI.indexingDone",
|
||||
&request_id_value,
|
||||
|
@ -531,7 +531,7 @@ void CommonWebContentsDelegate::OnDevToolsSearchCompleted(
|
|||
for (const auto& file_path : file_paths) {
|
||||
file_paths_value.AppendString(file_path);
|
||||
}
|
||||
base::FundamentalValue request_id_value(request_id);
|
||||
base::Value request_id_value(request_id);
|
||||
base::StringValue file_system_path_value(file_system_path);
|
||||
web_contents_->CallClientFunction("DevToolsAPI.searchCompleted",
|
||||
&request_id_value,
|
||||
|
|
|
@ -187,7 +187,7 @@ NativeWindowViews::NativeWindowViews(
|
|||
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
|
||||
params.bounds = bounds;
|
||||
params.delegate = this;
|
||||
params.type = views::Widget::InitParams::TYPE_WINDOW;
|
||||
params.type = views::Widget::InitParams::Type::WINDOW;
|
||||
params.remove_standard_frame = !has_frame();
|
||||
|
||||
if (transparent())
|
||||
|
|
|
@ -185,7 +185,7 @@ std::unique_ptr<net::SourceStream> URLRequestAsarJob::SetUpSourceStream() {
|
|||
// Bug 9936 - .svgz files needs to be decompressed.
|
||||
return base::LowerCaseEqualsASCII(file_path_.Extension(), ".svgz")
|
||||
? net::GzipSourceStream::Create(std::move(source),
|
||||
net::SourceStream::TYPE_GZIP)
|
||||
net::SourceStream::Type::GZIP)
|
||||
: std::move(source);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,11 +59,11 @@ void AskForOptions(v8::Isolate* isolate,
|
|||
}
|
||||
|
||||
bool IsErrorOptions(base::Value* value, int* error) {
|
||||
if (value->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||
if (value->IsType(base::Value::Type::DICTIONARY)) {
|
||||
base::DictionaryValue* dict = static_cast<base::DictionaryValue*>(value);
|
||||
if (dict->GetInteger("error", error))
|
||||
return true;
|
||||
} else if (value->IsType(base::Value::TYPE_INTEGER)) {
|
||||
} else if (value->IsType(base::Value::Type::INTEGER)) {
|
||||
if (value->GetAsInteger(error))
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -18,10 +18,10 @@ URLRequestAsyncAsarJob::URLRequestAsyncAsarJob(
|
|||
|
||||
void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||
base::FilePath::StringType file_path;
|
||||
if (options->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||
if (options->IsType(base::Value::Type::DICTIONARY)) {
|
||||
static_cast<base::DictionaryValue*>(options.get())->GetString(
|
||||
"path", &file_path);
|
||||
} else if (options->IsType(base::Value::TYPE_STRING)) {
|
||||
} else if (options->IsType(base::Value::Type::STRING)) {
|
||||
options->GetAsString(&file_path);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,13 +34,13 @@ URLRequestBufferJob::URLRequestBufferJob(
|
|||
|
||||
void URLRequestBufferJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||
const base::BinaryValue* binary = nullptr;
|
||||
if (options->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||
if (options->IsType(base::Value::Type::DICTIONARY)) {
|
||||
base::DictionaryValue* dict =
|
||||
static_cast<base::DictionaryValue*>(options.get());
|
||||
dict->GetString("mimeType", &mime_type_);
|
||||
dict->GetString("charset", &charset_);
|
||||
dict->GetBinary("data", &binary);
|
||||
} else if (options->IsType(base::Value::TYPE_BINARY)) {
|
||||
} else if (options->IsType(base::Value::Type::BINARY)) {
|
||||
options->GetAsBinary(&binary);
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ void URLRequestFetchJob::BeforeStartInUI(
|
|||
}
|
||||
|
||||
void URLRequestFetchJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||
if (!options->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||
if (!options->IsType(base::Value::Type::DICTIONARY)) {
|
||||
NotifyStartError(net::URLRequestStatus(
|
||||
net::URLRequestStatus::FAILED, net::ERR_NOT_IMPLEMENTED));
|
||||
return;
|
||||
|
|
|
@ -17,13 +17,13 @@ URLRequestStringJob::URLRequestStringJob(
|
|||
}
|
||||
|
||||
void URLRequestStringJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||
if (options->IsType(base::Value::TYPE::DICTIONARY)) {
|
||||
if (options->IsType(base::Value::Type::DICTIONARY)) {
|
||||
base::DictionaryValue* dict =
|
||||
static_cast<base::DictionaryValue*>(options.get());
|
||||
dict->GetString("mimeType", &mime_type_);
|
||||
dict->GetString("charset", &charset_);
|
||||
dict->GetString("data", &data_);
|
||||
} else if (options->IsType(base::Value::TYPE_STRING)) {
|
||||
} else if (options->IsType(base::Value::Type::STRING)) {
|
||||
options->GetAsString(&data_);
|
||||
}
|
||||
net::URLRequestSimpleJob::Start();
|
||||
|
|
|
@ -58,7 +58,7 @@ NodeDebugger::NodeDebugger(v8::Isolate* isolate)
|
|||
|
||||
// Start a new IO thread.
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_loop_type = base::MessageLoop::Type::IO;
|
||||
if (!thread_.StartWithOptions(options)) {
|
||||
LOG(ERROR) << "Unable to start debugger thread";
|
||||
return;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue