linux: Implement SetProgressBar API.
This commit is contained in:
parent
d8f57a0ecc
commit
d9ce3f0ca3
4 changed files with 20 additions and 1 deletions
|
@ -134,6 +134,13 @@ void App::ResolveProxy(const GURL& url, ResolveProxyCallback callback) {
|
||||||
new ResolveProxyHelper(url, 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(
|
mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
||||||
v8::Isolate* isolate) {
|
v8::Isolate* isolate) {
|
||||||
Browser* browser = Browser::Get();
|
Browser* browser = Browser::Get();
|
||||||
|
@ -151,7 +158,8 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
||||||
.SetMethod("setName", base::Bind(&Browser::SetName,
|
.SetMethod("setName", base::Bind(&Browser::SetName,
|
||||||
base::Unretained(browser)))
|
base::Unretained(browser)))
|
||||||
.SetMethod("getDataPath", &App::GetDataPath)
|
.SetMethod("getDataPath", &App::GetDataPath)
|
||||||
.SetMethod("resolveProxy", &App::ResolveProxy);
|
.SetMethod("resolveProxy", &App::ResolveProxy)
|
||||||
|
.SetMethod("setDesktopName", &App::SetDesktopName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -50,6 +50,7 @@ class App : public mate::EventEmitter,
|
||||||
private:
|
private:
|
||||||
base::FilePath GetDataPath();
|
base::FilePath GetDataPath();
|
||||||
void ResolveProxy(const GURL& url, ResolveProxyCallback callback);
|
void ResolveProxy(const GURL& url, ResolveProxyCallback callback);
|
||||||
|
void SetDesktopName(const std::string& desktop_name);
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(App);
|
DISALLOW_COPY_AND_ASSIGN(App);
|
||||||
};
|
};
|
||||||
|
|
|
@ -77,6 +77,12 @@ setImmediate ->
|
||||||
else if packageJson.name?
|
else if packageJson.name?
|
||||||
app.setName 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.
|
# Load the chrome extension support.
|
||||||
require './chrome-extension.js'
|
require './chrome-extension.js'
|
||||||
|
|
||||||
|
|
|
@ -501,6 +501,10 @@ void NativeWindowViews::SetProgressBar(double progress) {
|
||||||
static_cast<int>(progress * 100),
|
static_cast<int>(progress * 100),
|
||||||
progress);
|
progress);
|
||||||
}
|
}
|
||||||
|
#elif defined(USE_X11)
|
||||||
|
if (unity::IsRunning()) {
|
||||||
|
unity::SetProgressFraction(progress);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue