Using string from the std
This commit is contained in:
parent
526debb5ab
commit
9673cee4d7
6 changed files with 9 additions and 12 deletions
|
@ -729,7 +729,7 @@ void Window::SetAspectRatio(double aspect_ratio, mate::Arguments* args) {
|
||||||
window_->SetAspectRatio(aspect_ratio, extra_size);
|
window_->SetAspectRatio(aspect_ratio, extra_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::PreviewFile(const base::string16& filepath, const base::string16& filename) {
|
void Window::PreviewFile(const std::string& filepath, const std::string& filename) {
|
||||||
window_->PreviewFile(filepath, filename);
|
window_->PreviewFile(filepath, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ class Window : public mate::TrackableObject<Window>,
|
||||||
void SetMenuBarVisibility(bool visible);
|
void SetMenuBarVisibility(bool visible);
|
||||||
bool IsMenuBarVisible();
|
bool IsMenuBarVisible();
|
||||||
void SetAspectRatio(double aspect_ratio, mate::Arguments* args);
|
void SetAspectRatio(double aspect_ratio, mate::Arguments* args);
|
||||||
void PreviewFile(const base::string16& filepath, const base::string16& filename);
|
void PreviewFile(const std::string& filepath, const std::string& filename);
|
||||||
void SetParentWindow(v8::Local<v8::Value> value, mate::Arguments* args);
|
void SetParentWindow(v8::Local<v8::Value> value, mate::Arguments* args);
|
||||||
v8::Local<v8::Value> GetParentWindow() const;
|
v8::Local<v8::Value> GetParentWindow() const;
|
||||||
std::vector<v8::Local<v8::Object>> GetChildWindows() const;
|
std::vector<v8::Local<v8::Object>> GetChildWindows() const;
|
||||||
|
|
|
@ -374,7 +374,7 @@ void NativeWindow::SetAspectRatio(double aspect_ratio,
|
||||||
aspect_ratio_extraSize_ = extra_size;
|
aspect_ratio_extraSize_ = extra_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindow::PreviewFile(const base::string16& filepath, const base::string16& filename) {
|
void NativeWindow::PreviewFile(const std::string& filepath, const std::string& filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindow::RequestToClosePage() {
|
void NativeWindow::RequestToClosePage() {
|
||||||
|
|
|
@ -176,7 +176,7 @@ class NativeWindow : public base::SupportsUserData,
|
||||||
double GetAspectRatio();
|
double GetAspectRatio();
|
||||||
gfx::Size GetAspectRatioExtraSize();
|
gfx::Size GetAspectRatioExtraSize();
|
||||||
virtual void SetAspectRatio(double aspect_ratio, const gfx::Size& extra_size);
|
virtual void SetAspectRatio(double aspect_ratio, const gfx::Size& extra_size);
|
||||||
virtual void PreviewFile(const base::string16& filepath, const base::string16& filename);
|
virtual void PreviewFile(const std::string& filepath, const std::string& filename);
|
||||||
|
|
||||||
base::WeakPtr<NativeWindow> GetWeakPtr() {
|
base::WeakPtr<NativeWindow> GetWeakPtr() {
|
||||||
return weak_factory_.GetWeakPtr();
|
return weak_factory_.GetWeakPtr();
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <Quartz/Quartz.h>
|
|
||||||
|
|
||||||
#include "atom/browser/native_window.h"
|
#include "atom/browser/native_window.h"
|
||||||
#include "base/mac/scoped_nsobject.h"
|
#include "base/mac/scoped_nsobject.h"
|
||||||
|
@ -56,7 +55,8 @@ class NativeWindowMac : public NativeWindow,
|
||||||
void SetMovable(bool movable) override;
|
void SetMovable(bool movable) override;
|
||||||
void SetAspectRatio(double aspect_ratio, const gfx::Size& extra_size)
|
void SetAspectRatio(double aspect_ratio, const gfx::Size& extra_size)
|
||||||
override;
|
override;
|
||||||
void PreviewFile(const base::string16& filepath, const base::string16& filename) override;
|
void PreviewFile(const std::string& filepath, const std::string& filename)
|
||||||
|
override;
|
||||||
bool IsMovable() override;
|
bool IsMovable() override;
|
||||||
void SetMinimizable(bool minimizable) override;
|
void SetMinimizable(bool minimizable) override;
|
||||||
bool IsMinimizable() override;
|
bool IsMinimizable() override;
|
||||||
|
|
|
@ -956,14 +956,11 @@ void NativeWindowMac::SetAspectRatio(double aspect_ratio,
|
||||||
[window_ setResizeIncrements:NSMakeSize(1.0, 1.0)];
|
[window_ setResizeIncrements:NSMakeSize(1.0, 1.0)];
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowMac::PreviewFile(const base::string16& filepath, const base::string16& filename) {
|
void NativeWindowMac::PreviewFile(const std::string& filepath, const std::string& filename) {
|
||||||
std::string pathStr = base::UTF16ToUTF8(filepath);
|
NSString *path = [NSString stringWithCString:filepath.c_str()
|
||||||
std::string nameStr = base::UTF16ToUTF8(filename);
|
|
||||||
|
|
||||||
NSString *path = [NSString stringWithCString:pathStr.c_str()
|
|
||||||
encoding:[NSString defaultCStringEncoding]];
|
encoding:[NSString defaultCStringEncoding]];
|
||||||
|
|
||||||
NSString *name = [NSString stringWithCString:nameStr.c_str()
|
NSString *name = [NSString stringWithCString:filename.c_str()
|
||||||
encoding:[NSString defaultCStringEncoding]];
|
encoding:[NSString defaultCStringEncoding]];
|
||||||
|
|
||||||
[window_ previewFileAtPath:path withName:name];
|
[window_ previewFileAtPath:path withName:name];
|
||||||
|
|
Loading…
Reference in a new issue