From 823b3baed020753090c523fd1883d1b6147d2d5f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 28 Feb 2017 16:14:02 -0800 Subject: [PATCH] Use vector of dictionaries instead of mate::Arguments --- atom/browser/api/atom_api_window.cc | 4 ++-- atom/browser/api/atom_api_window.h | 3 ++- atom/browser/native_window.cc | 3 ++- atom/browser/native_window.h | 4 +++- atom/browser/native_window_mac.h | 5 ++--- atom/browser/native_window_mac.mm | 10 ++++------ 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 3f9b82af59f..fbfba8a9e69 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -849,8 +849,8 @@ void Window::DestroyTouchBar() { window_->DestroyTouchBar(); } -void Window::SetTouchBar(mate::Arguments* args) { - window_->SetTouchBar(args); +void Window::SetTouchBar(const std::vector& items) { + window_->SetTouchBar(items); } void Window::RefreshTouchBarItem(const std::string& item_id) { diff --git a/atom/browser/api/atom_api_window.h b/atom/browser/api/atom_api_window.h index 697dfa3e10c..b8060c3f47c 100644 --- a/atom/browser/api/atom_api_window.h +++ b/atom/browser/api/atom_api_window.h @@ -16,6 +16,7 @@ #include "atom/common/api/atom_api_native_image.h" #include "atom/common/key_weak_map.h" #include "native_mate/handle.h" +#include "native_mate/persistent_dictionary.h" #include "ui/gfx/image/image.h" class GURL; @@ -206,7 +207,7 @@ class Window : public mate::TrackableObject, void SetVibrancy(mate::Arguments* args); void DestroyTouchBar(); - void SetTouchBar(mate::Arguments* args); + void SetTouchBar(const std::vector& items); void RefreshTouchBarItem(const std::string& item_id); v8::Local WebContents(v8::Isolate* isolate); diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index fb34ee021e4..21d442c9207 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -344,7 +344,8 @@ void NativeWindow::SetVibrancy(const std::string& filename) { void NativeWindow::DestroyTouchBar() { } -void NativeWindow::SetTouchBar(mate::Arguments* args) { +void NativeWindow::SetTouchBar( + const std::vector& items) { } void NativeWindow::RefreshTouchBarItem(const std::string& item_id) { diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index 8e8b6130281..bb94127b7a3 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -22,6 +22,7 @@ #include "content/public/browser/web_contents_user_data.h" #include "extensions/browser/app_window/size_constraints.h" #include "native_mate/constructor.h" +#include "native_mate/persistent_dictionary.h" #include "ui/gfx/image/image.h" #include "ui/gfx/image/image_skia.h" @@ -172,7 +173,8 @@ class NativeWindow : public base::SupportsUserData, // Touchbar API virtual void DestroyTouchBar(); - virtual void SetTouchBar(mate::Arguments* args); + virtual void SetTouchBar( + const std::vector& items); virtual void RefreshTouchBarItem(const std::string& item_id); // Webview APIs. diff --git a/atom/browser/native_window_mac.h b/atom/browser/native_window_mac.h index d80ff42897b..388ea282c07 100644 --- a/atom/browser/native_window_mac.h +++ b/atom/browser/native_window_mac.h @@ -13,8 +13,6 @@ #include "atom/browser/native_window.h" #include "base/mac/scoped_nsobject.h" #include "content/public/browser/render_widget_host.h" -#include "native_mate/constructor.h" -#include "native_mate/persistent_dictionary.h" @class AtomNSWindow; @class AtomNSWindowDelegate; @@ -103,7 +101,8 @@ class NativeWindowMac : public NativeWindow, void SetVibrancy(const std::string& type) override; void DestroyTouchBar() override; - void SetTouchBar(mate::Arguments* args) override; + void SetTouchBar( + const std::vector& items) override; void RefreshTouchBarItem(const std::string& item_id) override; std::vector GetTouchBarItems(); diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 0dc3bd952b3..d93b1364584 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -1374,12 +1374,10 @@ void NativeWindowMac::DestroyTouchBar() { [window_ resetTouchBar]; } -void NativeWindowMac::SetTouchBar(mate::Arguments* args) { - std::vector items; - if (args->GetNext(&items)) { - touch_bar_items_ = items; - [window_ resetTouchBar]; - } +void NativeWindowMac::SetTouchBar( + const std::vector& items) { + touch_bar_items_ = items; + [window_ resetTouchBar]; } void NativeWindowMac::RefreshTouchBarItem(const std::string& item_id) {