зеркало из https://github.com/electron/electron.git
implement for osx
This commit is contained in:
Родитель
1f65b47e8e
Коммит
26f4d09b2c
|
@ -23,7 +23,6 @@
|
|||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/devtools_http_handler.h"
|
||||
#include "content/public/browser/host_zoom_map.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "net/http/http_response_headers.h"
|
||||
|
|
|
@ -24,6 +24,7 @@ class InspectableWebContentsViewMac : public InspectableWebContentsView {
|
|||
void SetIsDocked(bool docked) override;
|
||||
void SetContentsResizingStrategy(
|
||||
const DevToolsContentsResizingStrategy& strategy) override;
|
||||
void SetTitle(const base::string16& title) override;
|
||||
|
||||
InspectableWebContentsImpl* inspectable_web_contents() {
|
||||
return inspectable_web_contents_;
|
||||
|
|
|
@ -50,4 +50,8 @@ void InspectableWebContentsViewMac::SetContentsResizingStrategy(
|
|||
[view_ setContentsResizingStrategy:strategy];
|
||||
}
|
||||
|
||||
void InspectableWebContentsViewMac::SetTitle(const base::string16& title) {
|
||||
[view_ setTitle:title];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,5 +32,6 @@ using brightray::InspectableWebContentsViewMac;
|
|||
- (BOOL)isDevToolsVisible;
|
||||
- (void)setIsDocked:(BOOL)docked;
|
||||
- (void)setContentsResizingStrategy:(const DevToolsContentsResizingStrategy&)strategy;
|
||||
- (void)setTitle:(const base::string16&)title;
|
||||
|
||||
@end
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "browser/inspectable_web_contents_impl.h"
|
||||
#include "browser/inspectable_web_contents_view_mac.h"
|
||||
|
||||
|
@ -174,6 +175,13 @@ const CGFloat kRoundedCornerRadius = 4;
|
|||
[contentsView setFrame:[self flipRectToNSRect:new_contents_bounds]];
|
||||
}
|
||||
|
||||
- (void)setTitle:(const base::string16&)title {
|
||||
if (devtools_window_) {
|
||||
NSString* title_string = base::SysUTF16ToNSString(title);
|
||||
[devtools_window_ setTitle:title_string];
|
||||
}
|
||||
}
|
||||
|
||||
// Creates a path whose bottom two corners are rounded.
|
||||
// Caller takes ownership of the path.
|
||||
- (CGPathRef)createRoundedBottomCornersPath:(NSSize)size {
|
||||
|
|
Загрузка…
Ссылка в новой задаче