зеркало из https://github.com/electron/electron.git
Pass arguments instance through the chain in order to throw error
This commit is contained in:
Родитель
e84d7c0cda
Коммит
5336b4a89c
|
@ -1082,8 +1082,13 @@ void BrowserWindow::ToggleTabBar() {
|
|||
window_->ToggleTabBar();
|
||||
}
|
||||
|
||||
void BrowserWindow::AddTabbedWindow(NativeWindow* window) {
|
||||
window_->AddTabbedWindow(window);
|
||||
void BrowserWindow::AddTabbedWindow(mate::Arguments* args) {
|
||||
NativeWindow* window;
|
||||
if (!args->GetNext(&window)) {
|
||||
args->ThrowError("Insert good error message here");
|
||||
return;
|
||||
}
|
||||
window_->AddTabbedWindow(window, args);
|
||||
}
|
||||
|
||||
void BrowserWindow::SetVibrancy(mate::Arguments* args) {
|
||||
|
|
|
@ -243,7 +243,7 @@ class BrowserWindow : public mate::TrackableObject<BrowserWindow>,
|
|||
void MergeAllWindows();
|
||||
void MoveTabToNewWindow();
|
||||
void ToggleTabBar();
|
||||
void AddTabbedWindow(NativeWindow* window);
|
||||
void AddTabbedWindow(mate::Arguments* args);
|
||||
|
||||
void SetVibrancy(mate::Arguments* args);
|
||||
void SetTouchBar(const std::vector<mate::PersistentDictionary>& items);
|
||||
|
|
|
@ -336,7 +336,7 @@ void NativeWindow::MoveTabToNewWindow() {
|
|||
void NativeWindow::ToggleTabBar() {
|
||||
}
|
||||
|
||||
void NativeWindow::AddTabbedWindow(NativeWindow* window) {
|
||||
void NativeWindow::AddTabbedWindow(NativeWindow* window, mate::Arguments* args) {
|
||||
}
|
||||
|
||||
void NativeWindow::SetVibrancy(const std::string& filename) {
|
||||
|
|
|
@ -192,7 +192,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
virtual void MergeAllWindows();
|
||||
virtual void MoveTabToNewWindow();
|
||||
virtual void ToggleTabBar();
|
||||
virtual void AddTabbedWindow(NativeWindow* window);
|
||||
virtual void AddTabbedWindow(NativeWindow* window, mate::Arguments* args);
|
||||
|
||||
// Webview APIs.
|
||||
virtual void FocusOnWebView();
|
||||
|
|
|
@ -109,7 +109,7 @@ class NativeWindowMac : public NativeWindow {
|
|||
void MergeAllWindows() override;
|
||||
void MoveTabToNewWindow() override;
|
||||
void ToggleTabBar() override;
|
||||
void AddTabbedWindow(NativeWindow* window) override;
|
||||
void AddTabbedWindow(NativeWindow* window, mate::Arguments* args) override;
|
||||
|
||||
void SetVibrancy(const std::string& type) override;
|
||||
void SetTouchBar(
|
||||
|
|
|
@ -918,6 +918,7 @@ NativeWindowMac::NativeWindowMac(
|
|||
}
|
||||
|
||||
if (transparent()) {
|
||||
NSLog(@"Setting transparent");
|
||||
// Setting the background color to clear will also hide the shadow.
|
||||
[window_ setBackgroundColor:[NSColor clearColor]];
|
||||
}
|
||||
|
@ -1671,9 +1672,9 @@ void NativeWindowMac::ToggleTabBar() {
|
|||
}
|
||||
}
|
||||
|
||||
void NativeWindowMac::AddTabbedWindow(NativeWindow* window) {
|
||||
void NativeWindowMac::AddTabbedWindow(NativeWindow* window, mate::Arguments* args) {
|
||||
if (window_.get() == window->GetNativeWindow()) {
|
||||
NSLog(@"Error: AddTabbedWindow cannot be called by a window on itself.");
|
||||
args->ThrowError("AddTabbedWindow cannot be called by a window on itself");
|
||||
} else {
|
||||
if ([window_ respondsToSelector:@selector(addTabbedWindow:ordered:)]) {
|
||||
[window_ addTabbedWindow:window->GetNativeWindow() ordered:NSWindowAbove];
|
||||
|
|
Загрузка…
Ссылка в новой задаче