reused converted and fixed indentation
This commit is contained in:
parent
e9879a3e4b
commit
54ee12308d
2 changed files with 5 additions and 10 deletions
|
@ -68,7 +68,7 @@ void App::OnFinishLaunching() {
|
||||||
Emit("ready");
|
Emit("ready");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string App::GetDataPath() {
|
base::FilePath App::GetDataPath() {
|
||||||
base::FilePath path;
|
base::FilePath path;
|
||||||
#if defined(OS_LINUX)
|
#if defined(OS_LINUX)
|
||||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||||
|
@ -80,15 +80,9 @@ std::string App::GetDataPath() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
base::FilePath data_path = path.Append(
|
base::FilePath data_path = path.Append(
|
||||||
base::FilePath::FromUTF8Unsafe(Browser::Get()->GetName()));
|
base::FilePath::FromUTF8Unsafe(Browser::Get()->GetName()));
|
||||||
|
|
||||||
// FilePath.value() returns a std::wstring in windows and
|
return data_path;
|
||||||
// std::string on other platforms.
|
|
||||||
std::vector<char> writable(data_path.value().begin(),
|
|
||||||
data_path.value().end());
|
|
||||||
writable.push_back('\0');
|
|
||||||
|
|
||||||
return &writable[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "atom/browser/api/event_emitter.h"
|
#include "atom/browser/api/event_emitter.h"
|
||||||
#include "atom/browser/browser_observer.h"
|
#include "atom/browser/browser_observer.h"
|
||||||
|
#include "atom/common/native_mate_converters/file_path_converter.h"
|
||||||
#include "native_mate/handle.h"
|
#include "native_mate/handle.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
@ -34,7 +35,7 @@ class App : public mate::EventEmitter,
|
||||||
virtual void OnActivateWithNoOpenWindows() OVERRIDE;
|
virtual void OnActivateWithNoOpenWindows() OVERRIDE;
|
||||||
virtual void OnWillFinishLaunching() OVERRIDE;
|
virtual void OnWillFinishLaunching() OVERRIDE;
|
||||||
virtual void OnFinishLaunching() OVERRIDE;
|
virtual void OnFinishLaunching() OVERRIDE;
|
||||||
virtual std::string GetDataPath();
|
virtual base::FilePath GetDataPath();
|
||||||
|
|
||||||
// mate::Wrappable implementations:
|
// mate::Wrappable implementations:
|
||||||
virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue