Use mate::Dictionary instead of base::DictionaryValue for options.
mate::Dictionary can represent arbitray type, which matches our use.
This commit is contained in:
parent
0349fdfd67
commit
84e2c35611
12 changed files with 71 additions and 74 deletions
|
@ -7,7 +7,6 @@
|
|||
#include "atom/browser/api/atom_api_web_contents.h"
|
||||
#include "atom/browser/native_window.h"
|
||||
#include "atom/common/native_mate_converters/function_converter.h"
|
||||
#include "atom/common/native_mate_converters/value_converter.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
|
@ -61,7 +60,7 @@ void OnCapturePageDone(
|
|||
} // namespace
|
||||
|
||||
|
||||
Window::Window(base::DictionaryValue* options)
|
||||
Window::Window(const mate::Dictionary& options)
|
||||
: window_(NativeWindow::Create(options)) {
|
||||
window_->InitFromOptions(options);
|
||||
window_->AddObserver(this);
|
||||
|
@ -108,10 +107,8 @@ void Window::OnRendererResponsive() {
|
|||
}
|
||||
|
||||
// static
|
||||
mate::Wrappable* Window::New(mate::Arguments* args,
|
||||
const base::DictionaryValue& options) {
|
||||
scoped_ptr<base::DictionaryValue> copied_options(options.DeepCopy());
|
||||
return new Window(copied_options.get());
|
||||
mate::Wrappable* Window::New(const mate::Dictionary& options) {
|
||||
return new Window(options);
|
||||
}
|
||||
|
||||
void Window::Destroy() {
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
|
||||
class GURL;
|
||||
|
||||
namespace base {
|
||||
class DictionaryValue;
|
||||
}
|
||||
|
||||
namespace mate {
|
||||
class Arguments;
|
||||
class Dictionary;
|
||||
|
@ -35,8 +31,7 @@ class WebContents;
|
|||
class Window : public mate::EventEmitter,
|
||||
public NativeWindowObserver {
|
||||
public:
|
||||
static mate::Wrappable* New(mate::Arguments* args,
|
||||
const base::DictionaryValue& options);
|
||||
static mate::Wrappable* New(const mate::Dictionary& options);
|
||||
|
||||
static void BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Handle<v8::ObjectTemplate> prototype);
|
||||
|
@ -44,7 +39,7 @@ class Window : public mate::EventEmitter,
|
|||
NativeWindow* window() const { return window_.get(); }
|
||||
|
||||
protected:
|
||||
explicit Window(base::DictionaryValue* options);
|
||||
explicit Window(const mate::Dictionary& options);
|
||||
virtual ~Window();
|
||||
|
||||
// Implementations of NativeWindowObserver:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue