forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DevTools: add experimental method for configuring the dock tile.
This is an experimental feature that allows trusted remote debugging clients such as Carlo adjust the dock tile details. Change-Id: I7b263a14f1632d867c8bd3cffdd0527b3f3c96c9 Reviewed-on: https://chromium-review.googlesource.com/c/1337295 Commit-Queue: Dmitry Gozman <dgozman@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Cr-Commit-Position: refs/heads/master@{#608575}
- Loading branch information
1 parent
c5baed4
commit 8358f76
Showing
11 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/devtools/devtools_dock_tile.h" | ||
|
||
// static | ||
void DevToolsDockTile::Update(const std::string& label, gfx::Image image) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_DOCK_TILE_H_ | ||
#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_DOCK_TILE_H_ | ||
|
||
#include "base/macros.h" | ||
#include "ui/gfx/image/image.h" | ||
|
||
class DevToolsDockTile { | ||
public: | ||
static void Update(const std::string& label, gfx::Image image); | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(DevToolsDockTile); | ||
}; | ||
|
||
#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_DOCK_TILE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "base/mac/scoped_nsobject.h" | ||
#include "base/strings/sys_string_conversions.h" | ||
#include "chrome/browser/devtools/devtools_dock_tile.h" | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
// static | ||
void DevToolsDockTile::Update(const std::string& label, gfx::Image image) { | ||
NSDockTile* dockTile = [[NSApplication sharedApplication] dockTile]; | ||
if (!image.IsEmpty()) { | ||
NSRect imageFrame = NSMakeRect(0, 0, 0, 0); | ||
base::scoped_nsobject<NSImageView> imageView( | ||
[[NSImageView alloc] initWithFrame:imageFrame]); | ||
NSImage* nsImage = image.ToNSImage(); | ||
[imageView setImage:nsImage]; | ||
[dockTile setContentView:imageView]; | ||
} | ||
if (!label.empty()) | ||
[dockTile setBadgeLabel:base::SysUTF8ToNSString(label)]; | ||
[dockTile display]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters