Make everything pointer like

This commit is contained in:
Samuel Attard 2017-03-29 15:11:39 +11:00 committed by Kevin Sawicki
parent 2ba937289c
commit 60cc862031
10 changed files with 15 additions and 15 deletions

View file

@ -853,7 +853,7 @@ void Window::RefreshTouchBarItem(const std::string& item_id) {
window_->RefreshTouchBarItem(item_id); window_->RefreshTouchBarItem(item_id);
} }
void Window::SetEscapeTouchBarItem(const mate::PersistentDictionary item) { void Window::SetEscapeTouchBarItem(const mate::PersistentDictionary& item) {
window_->SetEscapeTouchBarItem(item); window_->SetEscapeTouchBarItem(item);
} }

View file

@ -208,7 +208,7 @@ class Window : public mate::TrackableObject<Window>,
void SetVibrancy(mate::Arguments* args); void SetVibrancy(mate::Arguments* args);
void SetTouchBar(const std::vector<mate::PersistentDictionary>& items); void SetTouchBar(const std::vector<mate::PersistentDictionary>& items);
void RefreshTouchBarItem(const std::string& item_id); void RefreshTouchBarItem(const std::string& item_id);
void SetEscapeTouchBarItem(const mate::PersistentDictionary item); void SetEscapeTouchBarItem(const mate::PersistentDictionary& item);
v8::Local<v8::Value> WebContents(v8::Isolate* isolate); v8::Local<v8::Value> WebContents(v8::Isolate* isolate);

View file

@ -347,7 +347,7 @@ void NativeWindow::SetTouchBar(
void NativeWindow::RefreshTouchBarItem(const std::string& item_id) { void NativeWindow::RefreshTouchBarItem(const std::string& item_id) {
} }
void NativeWindow::SetEscapeTouchBarItem(const mate::PersistentDictionary item) { void NativeWindow::SetEscapeTouchBarItem(const mate::PersistentDictionary& item) {
} }
void NativeWindow::FocusOnWebView() { void NativeWindow::FocusOnWebView() {

View file

@ -174,7 +174,7 @@ class NativeWindow : public base::SupportsUserData,
virtual void SetTouchBar( virtual void SetTouchBar(
const std::vector<mate::PersistentDictionary>& items); const std::vector<mate::PersistentDictionary>& items);
virtual void RefreshTouchBarItem(const std::string& item_id); virtual void RefreshTouchBarItem(const std::string& item_id);
virtual void SetEscapeTouchBarItem(const mate::PersistentDictionary item); virtual void SetEscapeTouchBarItem(const mate::PersistentDictionary& item);
// Webview APIs. // Webview APIs.
virtual void FocusOnWebView(); virtual void FocusOnWebView();

View file

@ -103,7 +103,7 @@ class NativeWindowMac : public NativeWindow,
void SetTouchBar( void SetTouchBar(
const std::vector<mate::PersistentDictionary>& items) override; const std::vector<mate::PersistentDictionary>& items) override;
void RefreshTouchBarItem(const std::string& item_id) override; void RefreshTouchBarItem(const std::string& item_id) override;
void SetEscapeTouchBarItem(const mate::PersistentDictionary item) override; void SetEscapeTouchBarItem(const mate::PersistentDictionary& item) override;
// content::RenderWidgetHost::InputEventObserver: // content::RenderWidgetHost::InputEventObserver:
void OnInputEvent(const blink::WebInputEvent& event) override; void OnInputEvent(const blink::WebInputEvent& event) override;

View file

@ -411,7 +411,7 @@ enum {
} }
-(void)setEscapeTouchBarItem:(mate::PersistentDictionary)item { -(void)setEscapeTouchBarItem:(mate::PersistentDictionary)item {
if (self.touchBar && atom_touch_bar_) if (atom_touch_bar_ && self.touchBar)
[atom_touch_bar_ setEscapeTouchBarItem:item forTouchBar:self.touchBar]; [atom_touch_bar_ setEscapeTouchBarItem:item forTouchBar:self.touchBar];
} }
@ -1422,7 +1422,7 @@ void NativeWindowMac::RefreshTouchBarItem(const std::string& item_id) {
[window_ refreshTouchBarItem:item_id]; [window_ refreshTouchBarItem:item_id];
} }
void NativeWindowMac::SetEscapeTouchBarItem(const mate::PersistentDictionary item) { void NativeWindowMac::SetEscapeTouchBarItem(const mate::PersistentDictionary& item) {
[window_ setEscapeTouchBarItem:item]; [window_ setEscapeTouchBarItem:item];
} }

View file

@ -31,8 +31,8 @@
- (NSTouchBar*)touchBarFromItemIdentifiers:(NSMutableArray*)items; - (NSTouchBar*)touchBarFromItemIdentifiers:(NSMutableArray*)items;
- (NSMutableArray*)identifiersFromSettings:(const std::vector<mate::PersistentDictionary>&)settings; - (NSMutableArray*)identifiersFromSettings:(const std::vector<mate::PersistentDictionary>&)settings;
- (void)refreshTouchBarItem:(NSTouchBar*)touchBar id:(const std::string&)item_id; - (void)refreshTouchBarItem:(NSTouchBar*)touchBar id:(const std::string&)item_id;
- (void)addNonDefaultTouchBarItems:(std::vector<mate::PersistentDictionary>)items; - (void)addNonDefaultTouchBarItems:(const std::vector<mate::PersistentDictionary>&)items;
- (void)setEscapeTouchBarItem:(mate::PersistentDictionary)item forTouchBar:(NSTouchBar*)touchBar; - (void)setEscapeTouchBarItem:(const mate::PersistentDictionary&)item forTouchBar:(NSTouchBar*)touchBar;
- (NSString*)idFromIdentifier:(NSString*)identifier withPrefix:(NSString*)prefix; - (NSString*)idFromIdentifier:(NSString*)identifier withPrefix:(NSString*)prefix;

View file

@ -147,11 +147,11 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
} }
} }
- (void)addNonDefaultTouchBarItems:(std::vector<mate::PersistentDictionary>)items { - (void)addNonDefaultTouchBarItems:(const std::vector<mate::PersistentDictionary>&)items {
[self identifiersFromSettings:items]; [self identifiersFromSettings:items];
} }
- (void)setEscapeTouchBarItem:(mate::PersistentDictionary)item forTouchBar:(NSTouchBar*)touchBar { - (void)setEscapeTouchBarItem:(const mate::PersistentDictionary&)item forTouchBar:(NSTouchBar*)touchBar {
std::string type; std::string type;
std::string item_id; std::string item_id;
NSTouchBarItemIdentifier identifier = nil; NSTouchBarItemIdentifier identifier = nil;

View file

@ -18,7 +18,7 @@ removed in future Electron releases.
The following methods are available on instances of `TouchBar`: The following methods are available on instances of `TouchBar`:
#### `touchBar.replaceEscapeItem([touchBarItem])` #### `touchBar.setEscapeItem([touchBarItem])`
* `touchBarItem` (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer) - (Optional) The touch bar item to replace the escape button with * `touchBarItem` (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer) - (Optional) The touch bar item to replace the escape button with

View file

@ -50,13 +50,13 @@ class TouchBar extends EventEmitter {
}) })
} }
replaceEscapeItem(item) { setEscapeItem(item) {
if (!item) item = {} if (!item) item = {}
Object.keys(this.windows).forEach((windowID) => { Object.keys(this.windows).forEach((windowID) => {
const window = this.windows[windowID] const window = this.windows[windowID]
window._setEscapeTouchBarItem(item) window._setEscapeTouchBarItem(item)
}) })
this._escape = item; this._escape = item
} }
_addToWindow (window) { _addToWindow (window) {
@ -90,7 +90,7 @@ class TouchBar extends EventEmitter {
} }
window.once('closed', removeListeners) window.once('closed', removeListeners)
this.windowListeners[id] = removeListeners this.windowListeners[id] = removeListeners
this.windows[id] = window; this.windows[id] = window
window._setTouchBarItems(this.ordereredItems) window._setTouchBarItems(this.ordereredItems)