From 26f4d09b2c3bf31067c43c26fddfcb20552343cd Mon Sep 17 00:00:00 2001 From: Robo Date: Fri, 7 Aug 2015 14:55:58 +0530 Subject: [PATCH] implement for osx --- brightray/browser/inspectable_web_contents_impl.cc | 1 - brightray/browser/inspectable_web_contents_view_mac.h | 1 + brightray/browser/inspectable_web_contents_view_mac.mm | 4 ++++ brightray/browser/mac/bry_inspectable_web_contents_view.h | 1 + .../browser/mac/bry_inspectable_web_contents_view.mm | 8 ++++++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index f66c23b81f..d2d5c19693 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -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" diff --git a/brightray/browser/inspectable_web_contents_view_mac.h b/brightray/browser/inspectable_web_contents_view_mac.h index fbe19adaeb..0dbb7beb82 100644 --- a/brightray/browser/inspectable_web_contents_view_mac.h +++ b/brightray/browser/inspectable_web_contents_view_mac.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_; diff --git a/brightray/browser/inspectable_web_contents_view_mac.mm b/brightray/browser/inspectable_web_contents_view_mac.mm index 6cd08da2f6..e676653953 100644 --- a/brightray/browser/inspectable_web_contents_view_mac.mm +++ b/brightray/browser/inspectable_web_contents_view_mac.mm @@ -50,4 +50,8 @@ void InspectableWebContentsViewMac::SetContentsResizingStrategy( [view_ setContentsResizingStrategy:strategy]; } +void InspectableWebContentsViewMac::SetTitle(const base::string16& title) { + [view_ setTitle:title]; +} + } diff --git a/brightray/browser/mac/bry_inspectable_web_contents_view.h b/brightray/browser/mac/bry_inspectable_web_contents_view.h index ea6e3f9a81..c3c5a1ada0 100644 --- a/brightray/browser/mac/bry_inspectable_web_contents_view.h +++ b/brightray/browser/mac/bry_inspectable_web_contents_view.h @@ -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 diff --git a/brightray/browser/mac/bry_inspectable_web_contents_view.mm b/brightray/browser/mac/bry_inspectable_web_contents_view.mm index a7f4134b4f..f2dac92973 100644 --- a/brightray/browser/mac/bry_inspectable_web_contents_view.mm +++ b/brightray/browser/mac/bry_inspectable_web_contents_view.mm @@ -2,6 +2,7 @@ #import +#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 {