linux: Implement SetProgressBar API.

This commit is contained in:
Haojian Wu 2014-09-18 04:12:24 -07:00
parent d8f57a0ecc
commit d9ce3f0ca3
4 changed files with 20 additions and 1 deletions

View file

@ -134,6 +134,13 @@ void App::ResolveProxy(const GURL& url, ResolveProxyCallback callback) {
new ResolveProxyHelper(url, callback);
}
void App::SetDesktopName(const std::string& desktop_name) {
#if defined(OS_LINUX)
scoped_ptr<base::Environment> env(base::Environment::Create());
env->SetVar("CHROME_DESKTOP", desktop_name);
#endif
}
mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
Browser* browser = Browser::Get();
@ -151,7 +158,8 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
.SetMethod("setName", base::Bind(&Browser::SetName,
base::Unretained(browser)))
.SetMethod("getDataPath", &App::GetDataPath)
.SetMethod("resolveProxy", &App::ResolveProxy);
.SetMethod("resolveProxy", &App::ResolveProxy)
.SetMethod("setDesktopName", &App::SetDesktopName);
}
// static

View file

@ -50,6 +50,7 @@ class App : public mate::EventEmitter,
private:
base::FilePath GetDataPath();
void ResolveProxy(const GURL& url, ResolveProxyCallback callback);
void SetDesktopName(const std::string& desktop_name);
DISALLOW_COPY_AND_ASSIGN(App);
};

View file

@ -77,6 +77,12 @@ setImmediate ->
else if packageJson.name?
app.setName packageJson.name
# Set application's desktop name.
if packageJson.desktopName?
app.setDesktopName packageJson.desktopName
else
app.setDesktopName 'atom-shell.desktop'
# Load the chrome extension support.
require './chrome-extension.js'

View file

@ -501,6 +501,10 @@ void NativeWindowViews::SetProgressBar(double progress) {
static_cast<int>(progress * 100),
progress);
}
#elif defined(USE_X11)
if (unity::IsRunning()) {
unity::SetProgressFraction(progress);
}
#endif
}