Index: generated_files_will_not_submit/windows.cc |
diff --git a/generated_files_will_not_submit/windows.cc b/generated_files_will_not_submit/windows.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..79e460906a7cd270edcc89718bf69b3dbc6fd0d9 |
--- /dev/null |
+++ b/generated_files_will_not_submit/windows.cc |
@@ -0,0 +1,369 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// GENERATED FROM THE API DEFINITION IN |
+// chrome/common/extensions/api/windows.json |
+// DO NOT EDIT. |
+ |
+#include "tools/json_schema_compiler/util.h" |
+#include "chrome/common/extensions/api/windows.h" |
+#include "chrome/common/extensions/api/tabs.h" |
+ |
+ |
+namespace extensions { |
+namespace api { |
+namespace windows { |
+ |
+// |
+// Types |
+// |
+ |
+Window::Window() {} |
+Window::~Window() {} |
+ |
+// static |
+bool Window::Populate(const Value& value, Window* out) { |
+ if (!value.IsType(Value::TYPE_DICTIONARY)) |
+ return false; |
+ const DictionaryValue* dict = static_cast<const DictionaryValue*>(&value); |
+ |
+ out->tabs.reset(new std::vector<linked_ptr<tabs::Tab> >); |
+ json_schema_compiler::util::GetOptionalArrayFromDictionary(*dict, "tabs", &out->tabs); |
+ if(!dict->GetInteger("top", &out->top)) |
+ return false; |
+ if(!dict->GetInteger("height", &out->height)) |
+ return false; |
+ if(!dict->GetInteger("width", &out->width)) |
+ return false; |
+ if(!dict->GetString("state", &out->state)) |
+ return false; |
+ if(!dict->GetBoolean("focused", &out->focused)) |
+ return false; |
+ if(!dict->GetInteger("left", &out->left)) |
+ return false; |
+ if(!dict->GetString("type", &out->type)) |
+ return false; |
+ if(!dict->GetInteger("id", &out->id)) |
+ return false; |
+ if(!dict->GetBoolean("incognito", &out->incognito)) |
+ return false; |
+ return true; |
+} |
+ |
+DictionaryValue* Window::ToValue() const { |
+ DictionaryValue* value = new DictionaryValue(); |
+ |
+ json_schema_compiler::util::SetOptionalArrayFromDictionary(tabs, "tabs", value); |
+ value->SetWithoutPathExpansion("top", Value::CreateIntegerValue(top)); |
+ value->SetWithoutPathExpansion("height", Value::CreateIntegerValue(height)); |
+ value->SetWithoutPathExpansion("width", Value::CreateIntegerValue(width)); |
+ value->SetWithoutPathExpansion("state", Value::CreateStringValue(state)); |
+ value->SetWithoutPathExpansion("focused", Value::CreateBooleanValue(focused)); |
+ value->SetWithoutPathExpansion("left", Value::CreateIntegerValue(left)); |
+ value->SetWithoutPathExpansion("type", Value::CreateStringValue(type)); |
+ value->SetWithoutPathExpansion("id", Value::CreateIntegerValue(id)); |
+ value->SetWithoutPathExpansion("incognito", Value::CreateBooleanValue(incognito)); |
+ |
+ return value; |
+} |
+ |
+ |
+// |
+// Functions |
+// |
+ |
+Get::Params::GetInfo::GetInfo() {} |
+Get::Params::GetInfo::~GetInfo() {} |
+ |
+// static |
+bool Get::Params::GetInfo::Populate(const Value& value, GetInfo* out) { |
+ if (!value.IsType(Value::TYPE_DICTIONARY)) |
+ return false; |
+ const DictionaryValue* dict = static_cast<const DictionaryValue*>(&value); |
+ |
+ out->populate.reset(new bool); |
+ dict->GetBoolean("populate", out->populate.get()); |
+ return true; |
+} |
+ |
+ |
+ |
+Get::Params::Params() {} |
+Get::Params::~Params() {} |
+ |
+// static |
+scoped_ptr<Get::Params> Get::Params::Create(const ListValue& args) { |
+ |
+ scoped_ptr<Params> params(new Params()); |
+ |
+ if(!args.GetInteger(0, ¶ms->window_id)) |
+ return scoped_ptr<Params>(); |
+ |
+ DictionaryValue* get_info_param = NULL; |
+ if (!args.GetDictionary(1, &get_info_param)) |
+ return params.Pass(); |
+ params->get_info.reset(new GetInfo()); |
+ if(!GetInfo::Populate(*get_info_param, params->get_info.get())) |
+ return params.Pass(); |
+ |
+ return params.Pass(); |
+} |
+ |
+// static |
+Value* Get::Result::Create(const Window& window) { |
+ return window.ToValue(); |
+} |
+ |
+GetCurrent::Params::GetInfo::GetInfo() {} |
+GetCurrent::Params::GetInfo::~GetInfo() {} |
+ |
+// static |
+bool GetCurrent::Params::GetInfo::Populate(const Value& value, GetInfo* out) { |
+ if (!value.IsType(Value::TYPE_DICTIONARY)) |
+ return false; |
+ const DictionaryValue* dict = static_cast<const DictionaryValue*>(&value); |
+ |
+ out->populate.reset(new bool); |
+ dict->GetBoolean("populate", out->populate.get()); |
+ return true; |
+} |
+ |
+ |
+ |
+GetCurrent::Params::Params() {} |
+GetCurrent::Params::~Params() {} |
+ |
+// static |
+scoped_ptr<GetCurrent::Params> GetCurrent::Params::Create(const ListValue& args) { |
+ |
+ scoped_ptr<Params> params(new Params()); |
+ |
+ DictionaryValue* get_info_param = NULL; |
+ if (!args.GetDictionary(0, &get_info_param)) |
+ return params.Pass(); |
+ params->get_info.reset(new GetInfo()); |
+ if(!GetInfo::Populate(*get_info_param, params->get_info.get())) |
+ return params.Pass(); |
+ |
+ return params.Pass(); |
+} |
+ |
+// static |
+Value* GetCurrent::Result::Create(const Window& window) { |
+ return window.ToValue(); |
+} |
+ |
+Create::Params::CreateData::CreateData() {} |
+Create::Params::CreateData::~CreateData() {} |
+ |
+// static |
+bool Create::Params::CreateData::Populate(const Value& value, CreateData* out) { |
+ if (!value.IsType(Value::TYPE_DICTIONARY)) |
+ return false; |
+ const DictionaryValue* dict = static_cast<const DictionaryValue*>(&value); |
+ |
+ out->tab_id.reset(new int); |
+ dict->GetInteger("tabId", out->tab_id.get()); |
+ if(!json_schema_compiler::util::GetArrayFromDictionary(*dict, "createData", &out->create_data_array)) |
+ return false; |
+ out->top.reset(new int); |
+ dict->GetInteger("top", out->top.get()); |
+ out->height.reset(new int); |
+ dict->GetInteger("height", out->height.get()); |
+ out->width.reset(new int); |
+ dict->GetInteger("width", out->width.get()); |
+ out->focused.reset(new bool); |
+ dict->GetBoolean("focused", out->focused.get()); |
+ out->left.reset(new int); |
+ dict->GetInteger("left", out->left.get()); |
+ out->type.reset(new std::string); |
+ dict->GetString("type", out->type.get()); |
+ out->incognito.reset(new bool); |
+ dict->GetBoolean("incognito", out->incognito.get()); |
+ return true; |
+} |
+ |
+ |
+ |
+Create::Params::Params() {} |
+Create::Params::~Params() {} |
+ |
+// static |
+scoped_ptr<Create::Params> Create::Params::Create(const ListValue& args) { |
+ |
+ scoped_ptr<Params> params(new Params()); |
+ |
+ DictionaryValue* create_data_param = NULL; |
+ if (!args.GetDictionary(0, &create_data_param)) |
+ return params.Pass(); |
+ params->create_data.reset(new CreateData()); |
+ if(!CreateData::Populate(*create_data_param, params->create_data.get())) |
+ return params.Pass(); |
+ |
+ return params.Pass(); |
+} |
+ |
+// static |
+// Contains details about the created window. |
+Value* Create::Result::Create(const Window& window) { |
+ return window.ToValue(); |
+} |
+ |
+GetAll::Params::GetInfo::GetInfo() {} |
+GetAll::Params::GetInfo::~GetInfo() {} |
+ |
+// static |
+bool GetAll::Params::GetInfo::Populate(const Value& value, GetInfo* out) { |
+ if (!value.IsType(Value::TYPE_DICTIONARY)) |
+ return false; |
+ const DictionaryValue* dict = static_cast<const DictionaryValue*>(&value); |
+ |
+ out->populate.reset(new bool); |
+ dict->GetBoolean("populate", out->populate.get()); |
+ return true; |
+} |
+ |
+ |
+ |
+GetAll::Params::Params() {} |
+GetAll::Params::~Params() {} |
+ |
+// static |
+scoped_ptr<GetAll::Params> GetAll::Params::Create(const ListValue& args) { |
+ |
+ scoped_ptr<Params> params(new Params()); |
+ |
+ DictionaryValue* get_info_param = NULL; |
+ if (!args.GetDictionary(0, &get_info_param)) |
+ return params.Pass(); |
+ params->get_info.reset(new GetInfo()); |
+ if(!GetInfo::Populate(*get_info_param, params->get_info.get())) |
+ return params.Pass(); |
+ |
+ return params.Pass(); |
+} |
+ |
+// static |
+Value* GetAll::Result::Create(const std::vector<linked_ptr<Window> > windows) { |
+ ListValue* l = new ListValue(); |
+ for (std::vector<linked_ptr<Window> >::const_iterator it = windows.begin(); it != windows.end(); ++it) { |
+ l->Append((**it).ToValue()); |
+ } |
+ return l; |
+} |
+ |
+Update::Params::UpdateInfo::UpdateInfo() {} |
+Update::Params::UpdateInfo::~UpdateInfo() {} |
+ |
+// static |
+bool Update::Params::UpdateInfo::Populate(const Value& value, UpdateInfo* out) { |
+ if (!value.IsType(Value::TYPE_DICTIONARY)) |
+ return false; |
+ const DictionaryValue* dict = static_cast<const DictionaryValue*>(&value); |
+ |
+ out->top.reset(new int); |
+ dict->GetInteger("top", out->top.get()); |
+ out->draw_attention.reset(new bool); |
+ dict->GetBoolean("drawAttention", out->draw_attention.get()); |
+ out->height.reset(new int); |
+ dict->GetInteger("height", out->height.get()); |
+ out->width.reset(new int); |
+ dict->GetInteger("width", out->width.get()); |
+ out->state.reset(new std::string); |
+ dict->GetString("state", out->state.get()); |
+ out->focused.reset(new bool); |
+ dict->GetBoolean("focused", out->focused.get()); |
+ out->left.reset(new int); |
+ dict->GetInteger("left", out->left.get()); |
+ return true; |
+} |
+ |
+ |
+ |
+Update::Params::Params() {} |
+Update::Params::~Params() {} |
+ |
+// static |
+scoped_ptr<Update::Params> Update::Params::Create(const ListValue& args) { |
+ |
+ scoped_ptr<Params> params(new Params()); |
+ |
+ if(!args.GetInteger(0, ¶ms->window_id)) |
+ return scoped_ptr<Params>(); |
+ |
+ DictionaryValue* update_info_param = NULL; |
+ if (!args.GetDictionary(1, &update_info_param)) |
+ return scoped_ptr<Params>(); |
+ if(!UpdateInfo::Populate(*update_info_param, ¶ms->update_info)) |
+ return scoped_ptr<Params>(); |
+ |
+ return params.Pass(); |
+} |
+ |
+// static |
+Value* Update::Result::Create(const Window& window) { |
+ return window.ToValue(); |
+} |
+ |
+Remove::Params::Params() {} |
+Remove::Params::~Params() {} |
+ |
+// static |
+scoped_ptr<Remove::Params> Remove::Params::Create(const ListValue& args) { |
+ |
+ scoped_ptr<Params> params(new Params()); |
+ |
+ if(!args.GetInteger(0, ¶ms->window_id)) |
+ return scoped_ptr<Params>(); |
+ |
+ return params.Pass(); |
+} |
+ |
+// static |
+Value* Remove::Result::Create() { |
+ return Value::CreateNullValue(); |
+} |
+ |
+GetLastFocused::Params::GetInfo::GetInfo() {} |
+GetLastFocused::Params::GetInfo::~GetInfo() {} |
+ |
+// static |
+bool GetLastFocused::Params::GetInfo::Populate(const Value& value, GetInfo* out) { |
+ if (!value.IsType(Value::TYPE_DICTIONARY)) |
+ return false; |
+ const DictionaryValue* dict = static_cast<const DictionaryValue*>(&value); |
+ |
+ out->populate.reset(new bool); |
+ dict->GetBoolean("populate", out->populate.get()); |
+ return true; |
+} |
+ |
+ |
+ |
+GetLastFocused::Params::Params() {} |
+GetLastFocused::Params::~Params() {} |
+ |
+// static |
+scoped_ptr<GetLastFocused::Params> GetLastFocused::Params::Create(const ListValue& args) { |
+ |
+ scoped_ptr<Params> params(new Params()); |
+ |
+ DictionaryValue* get_info_param = NULL; |
+ if (!args.GetDictionary(0, &get_info_param)) |
+ return params.Pass(); |
+ params->get_info.reset(new GetInfo()); |
+ if(!GetInfo::Populate(*get_info_param, params->get_info.get())) |
+ return params.Pass(); |
+ |
+ return params.Pass(); |
+} |
+ |
+// static |
+Value* GetLastFocused::Result::Create(const Window& window) { |
+ return window.ToValue(); |
+} |
+ |
+} // windows |
+} // api |
+} // extensions |