X Tutup
Skip to content

Commit 60cc862

Browse files
MarshallOfSoundkevinsawicki
authored andcommitted
Make everything pointer like
1 parent 2ba9372 commit 60cc862

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

atom/browser/api/atom_api_window.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ void Window::RefreshTouchBarItem(const std::string& item_id) {
853853
window_->RefreshTouchBarItem(item_id);
854854
}
855855

856-
void Window::SetEscapeTouchBarItem(const mate::PersistentDictionary item) {
856+
void Window::SetEscapeTouchBarItem(const mate::PersistentDictionary& item) {
857857
window_->SetEscapeTouchBarItem(item);
858858
}
859859

atom/browser/api/atom_api_window.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class Window : public mate::TrackableObject<Window>,
208208
void SetVibrancy(mate::Arguments* args);
209209
void SetTouchBar(const std::vector<mate::PersistentDictionary>& items);
210210
void RefreshTouchBarItem(const std::string& item_id);
211-
void SetEscapeTouchBarItem(const mate::PersistentDictionary item);
211+
void SetEscapeTouchBarItem(const mate::PersistentDictionary& item);
212212

213213
v8::Local<v8::Value> WebContents(v8::Isolate* isolate);
214214

atom/browser/native_window.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ void NativeWindow::SetTouchBar(
347347
void NativeWindow::RefreshTouchBarItem(const std::string& item_id) {
348348
}
349349

350-
void NativeWindow::SetEscapeTouchBarItem(const mate::PersistentDictionary item) {
350+
void NativeWindow::SetEscapeTouchBarItem(const mate::PersistentDictionary& item) {
351351
}
352352

353353
void NativeWindow::FocusOnWebView() {

atom/browser/native_window.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class NativeWindow : public base::SupportsUserData,
174174
virtual void SetTouchBar(
175175
const std::vector<mate::PersistentDictionary>& items);
176176
virtual void RefreshTouchBarItem(const std::string& item_id);
177-
virtual void SetEscapeTouchBarItem(const mate::PersistentDictionary item);
177+
virtual void SetEscapeTouchBarItem(const mate::PersistentDictionary& item);
178178

179179
// Webview APIs.
180180
virtual void FocusOnWebView();

atom/browser/native_window_mac.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class NativeWindowMac : public NativeWindow,
103103
void SetTouchBar(
104104
const std::vector<mate::PersistentDictionary>& items) override;
105105
void RefreshTouchBarItem(const std::string& item_id) override;
106-
void SetEscapeTouchBarItem(const mate::PersistentDictionary item) override;
106+
void SetEscapeTouchBarItem(const mate::PersistentDictionary& item) override;
107107

108108
// content::RenderWidgetHost::InputEventObserver:
109109
void OnInputEvent(const blink::WebInputEvent& event) override;

atom/browser/native_window_mac.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ - (NSTouchBarItem*)touchBar:(NSTouchBar*)touchBar
411411
}
412412

413413
-(void)setEscapeTouchBarItem:(mate::PersistentDictionary)item {
414-
if (self.touchBar && atom_touch_bar_)
414+
if (atom_touch_bar_ && self.touchBar)
415415
[atom_touch_bar_ setEscapeTouchBarItem:item forTouchBar:self.touchBar];
416416
}
417417

@@ -1422,7 +1422,7 @@ static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
14221422
[window_ refreshTouchBarItem:item_id];
14231423
}
14241424

1425-
void NativeWindowMac::SetEscapeTouchBarItem(const mate::PersistentDictionary item) {
1425+
void NativeWindowMac::SetEscapeTouchBarItem(const mate::PersistentDictionary& item) {
14261426
[window_ setEscapeTouchBarItem:item];
14271427
}
14281428

atom/browser/ui/cocoa/atom_touch_bar.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
- (NSTouchBar*)touchBarFromItemIdentifiers:(NSMutableArray*)items;
3232
- (NSMutableArray*)identifiersFromSettings:(const std::vector<mate::PersistentDictionary>&)settings;
3333
- (void)refreshTouchBarItem:(NSTouchBar*)touchBar id:(const std::string&)item_id;
34-
- (void)addNonDefaultTouchBarItems:(std::vector<mate::PersistentDictionary>)items;
35-
- (void)setEscapeTouchBarItem:(mate::PersistentDictionary)item forTouchBar:(NSTouchBar*)touchBar;
34+
- (void)addNonDefaultTouchBarItems:(const std::vector<mate::PersistentDictionary>&)items;
35+
- (void)setEscapeTouchBarItem:(const mate::PersistentDictionary&)item forTouchBar:(NSTouchBar*)touchBar;
3636

3737

3838
- (NSString*)idFromIdentifier:(NSString*)identifier withPrefix:(NSString*)prefix;

atom/browser/ui/cocoa/atom_touch_bar.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ - (void)refreshTouchBarItem:(NSTouchBar*)touchBar
147147
}
148148
}
149149

150-
- (void)addNonDefaultTouchBarItems:(std::vector<mate::PersistentDictionary>)items {
150+
- (void)addNonDefaultTouchBarItems:(const std::vector<mate::PersistentDictionary>&)items {
151151
[self identifiersFromSettings:items];
152152
}
153153

154-
- (void)setEscapeTouchBarItem:(mate::PersistentDictionary)item forTouchBar:(NSTouchBar*)touchBar {
154+
- (void)setEscapeTouchBarItem:(const mate::PersistentDictionary&)item forTouchBar:(NSTouchBar*)touchBar {
155155
std::string type;
156156
std::string item_id;
157157
NSTouchBarItemIdentifier identifier = nil;

docs/api/touch-bar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ removed in future Electron releases.
1818

1919
The following methods are available on instances of `TouchBar`:
2020

21-
#### `touchBar.replaceEscapeItem([touchBarItem])`
21+
#### `touchBar.setEscapeItem([touchBarItem])`
2222

2323
* `touchBarItem` (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer) - (Optional) The touch bar item to replace the escape button with
2424

lib/browser/api/touch-bar.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ class TouchBar extends EventEmitter {
5050
})
5151
}
5252

53-
replaceEscapeItem(item) {
53+
setEscapeItem(item) {
5454
if (!item) item = {}
5555
Object.keys(this.windows).forEach((windowID) => {
5656
const window = this.windows[windowID]
5757
window._setEscapeTouchBarItem(item)
5858
})
59-
this._escape = item;
59+
this._escape = item
6060
}
6161

6262
_addToWindow (window) {
@@ -90,7 +90,7 @@ class TouchBar extends EventEmitter {
9090
}
9191
window.once('closed', removeListeners)
9292
this.windowListeners[id] = removeListeners
93-
this.windows[id] = window;
93+
this.windows[id] = window
9494

9595
window._setTouchBarItems(this.ordereredItems)
9696

0 commit comments

Comments
 (0)
X Tutup