move native-mate back into the api layer
This commit is contained in:
parent
837a2d4bbd
commit
2abc69780e
5 changed files with 11 additions and 9 deletions
|
@ -1084,7 +1084,9 @@ void BrowserWindow::ToggleTabBar() {
|
|||
|
||||
void BrowserWindow::AddTabbedWindow(NativeWindow* window,
|
||||
mate::Arguments* args) {
|
||||
window_->AddTabbedWindow(window, args);
|
||||
const bool windowAdded = window_->AddTabbedWindow(window);
|
||||
if (!windowAdded)
|
||||
args->ThrowError("AddTabbedWindow cannot be called by a window on itself");
|
||||
}
|
||||
|
||||
void BrowserWindow::SetVibrancy(mate::Arguments* args) {
|
||||
|
|
|
@ -336,8 +336,8 @@ void NativeWindow::MoveTabToNewWindow() {
|
|||
void NativeWindow::ToggleTabBar() {
|
||||
}
|
||||
|
||||
void NativeWindow::AddTabbedWindow(NativeWindow* window,
|
||||
mate::Arguments* args) {
|
||||
bool NativeWindow::AddTabbedWindow(NativeWindow* window) {
|
||||
return true; // for non-Mac platforms
|
||||
}
|
||||
|
||||
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, mate::Arguments* args);
|
||||
virtual bool AddTabbedWindow(NativeWindow* window);
|
||||
|
||||
// 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, mate::Arguments* args) override;
|
||||
bool AddTabbedWindow(NativeWindow* window) override;
|
||||
|
||||
void SetVibrancy(const std::string& type) override;
|
||||
void SetTouchBar(
|
||||
|
|
|
@ -1672,14 +1672,14 @@ void NativeWindowMac::ToggleTabBar() {
|
|||
}
|
||||
}
|
||||
|
||||
void NativeWindowMac::AddTabbedWindow(NativeWindow* window, mate::Arguments* args) {
|
||||
bool NativeWindowMac::AddTabbedWindow(NativeWindow* window) {
|
||||
if (window_.get() == window->GetNativeWindow()) {
|
||||
args->ThrowError("AddTabbedWindow cannot be called by a window on itself");
|
||||
return false;
|
||||
} else {
|
||||
if ([window_ respondsToSelector:@selector(addTabbedWindow:ordered:)]) {
|
||||
if ([window_ respondsToSelector:@selector(addTabbedWindow:ordered:)])
|
||||
[window_ addTabbedWindow:window->GetNativeWindow() ordered:NSWindowAbove];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetRenderWidgetHostOpaque(bool opaque) {
|
||||
|
|
Loading…
Reference in a new issue