| Index: chrome/browser/devtools/devtools_embedder_message_dispatcher.cc
|
| diff --git a/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc b/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc
|
| index 9cf39ef75b261e1e089b449a7fd19cd06ad8ea0b..21d34647b63bea653bed8e184e5552cb355d18aa 100644
|
| --- a/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc
|
| +++ b/chrome/browser/devtools/devtools_embedder_message_dispatcher.cc
|
| @@ -21,6 +21,36 @@ bool GetValue(const base::ListValue& list, int pos, bool& value) {
|
| return list.GetBoolean(pos, &value);
|
| }
|
|
|
| +bool GetValue(const base::ListValue& list, int pos, gfx::Insets& insets) {
|
| + const base::DictionaryValue* dict;
|
| + if (!list.GetDictionary(pos, &dict))
|
| + return false;
|
| + int top = 0;
|
| + int left = 0;
|
| + int bottom = 0;
|
| + int right = 0;
|
| + if (!dict->GetInteger("top", &top) ||
|
| + !dict->GetInteger("left", &left) ||
|
| + !dict->GetInteger("bottom", &bottom) ||
|
| + !dict->GetInteger("right", &right))
|
| + return false;
|
| + insets.Set(top, left, bottom, right);
|
| + return true;
|
| +}
|
| +
|
| +bool GetValue(const base::ListValue& list, int pos, gfx::Size& size) {
|
| + const base::DictionaryValue* dict;
|
| + if (!list.GetDictionary(pos, &dict))
|
| + return false;
|
| + int width = 0;
|
| + int height = 0;
|
| + if (!dict->GetInteger("width", &width) ||
|
| + !dict->GetInteger("height", &height))
|
| + return false;
|
| + size.SetSize(width, height);
|
| + return true;
|
| +}
|
| +
|
| template <typename T>
|
| struct StorageTraits {
|
| typedef T StorageType;
|
| @@ -161,6 +191,9 @@ DevToolsEmbedderMessageDispatcher::DevToolsEmbedderMessageDispatcher(
|
| RegisterHandler("setContentsInsets",
|
| BindToListParser(base::Bind(&Delegate::SetContentsInsets,
|
| base::Unretained(delegate))));
|
| + RegisterHandler("setContentsResizingStrategy",
|
| + BindToListParser(base::Bind(&Delegate::SetContentsResizingStrategy,
|
| + base::Unretained(delegate))));
|
| RegisterHandler("inspectElementCompleted",
|
| BindToListParser(base::Bind(&Delegate::InspectElementCompleted,
|
| base::Unretained(delegate))));
|
|
|