Fix compilation errors on Linux.
This commit is contained in:
parent
ad19381217
commit
436deddf68
4 changed files with 4 additions and 48 deletions
|
@ -98,7 +98,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
|
||||||
sandbox::SandboxInterfaceInfo sandbox_info = {0};
|
sandbox::SandboxInterfaceInfo sandbox_info = {0};
|
||||||
content::InitializeSandboxInfo(&sandbox_info);
|
content::InitializeSandboxInfo(&sandbox_info);
|
||||||
atom::AtomMainDelegate delegate;
|
atom::AtomMainDelegate delegate;
|
||||||
return content::ContentMain(instance, &sandbox_info, &delegate);
|
return content::ContentMain(content::ContentMainParams(&delegate));
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(OS_LINUX) // defined(OS_WIN)
|
#elif defined(OS_LINUX) // defined(OS_WIN)
|
||||||
|
@ -109,7 +109,7 @@ int main(int argc, const char* argv[]) {
|
||||||
return node::Start(argc, const_cast<char**>(argv));
|
return node::Start(argc, const_cast<char**>(argv));
|
||||||
|
|
||||||
atom::AtomMainDelegate delegate;
|
atom::AtomMainDelegate delegate;
|
||||||
return content::ContentMain(argc, argv, &delegate);
|
return content::ContentMain(content::ContentMainParams(&delegate));
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // defined(OS_LINUX)
|
#else // defined(OS_LINUX)
|
||||||
|
|
|
@ -137,13 +137,12 @@ base::FilePath CreateTempImageFile(gfx::ImageSkia* image_ptr,
|
||||||
// Create a new temporary directory for each image since using a single
|
// Create a new temporary directory for each image since using a single
|
||||||
// temporary directory seems to have issues when changing icons in quick
|
// temporary directory seems to have issues when changing icons in quick
|
||||||
// succession.
|
// succession.
|
||||||
if (!file_util::CreateNewTempDirectory(base::FilePath::StringType(),
|
if (!base::CreateNewTempDirectory(base::FilePath::StringType(), &temp_dir))
|
||||||
&temp_dir))
|
|
||||||
return base::FilePath();
|
return base::FilePath();
|
||||||
new_file_path =
|
new_file_path =
|
||||||
temp_dir.Append(id + base::StringPrintf("_%d.png", icon_change_count));
|
temp_dir.Append(id + base::StringPrintf("_%d.png", icon_change_count));
|
||||||
int bytes_written =
|
int bytes_written =
|
||||||
file_util::WriteFile(
|
base::WriteFile(
|
||||||
new_file_path,
|
new_file_path,
|
||||||
reinterpret_cast<const char*>(png_data->front()),
|
reinterpret_cast<const char*>(png_data->front()),
|
||||||
png_data->size());
|
png_data->size());
|
||||||
|
|
|
@ -23,44 +23,6 @@ static guint32 last_click_time;
|
||||||
static int last_click_x;
|
static int last_click_x;
|
||||||
static int last_click_y;
|
static int last_click_y;
|
||||||
|
|
||||||
// Performs Cut/Copy/Paste operation on the |window|.
|
|
||||||
// If the current render view is focused, then just call the specified |method|
|
|
||||||
// against the current render view host, otherwise emit the specified |signal|
|
|
||||||
// against the focused widget.
|
|
||||||
// TODO(suzhe): This approach does not work for plugins.
|
|
||||||
void DoCutCopyPaste(GtkWindow* window,
|
|
||||||
WebContents* web_contents,
|
|
||||||
void (RenderWidgetHost::*method)(),
|
|
||||||
const char* signal) {
|
|
||||||
GtkWidget* widget = gtk_window_get_focus(window);
|
|
||||||
if (widget == NULL)
|
|
||||||
return; // Do nothing if no focused widget.
|
|
||||||
|
|
||||||
if (web_contents &&
|
|
||||||
widget == web_contents->GetView()->GetContentNativeView()) {
|
|
||||||
(web_contents->GetRenderViewHost()->*method)();
|
|
||||||
} else {
|
|
||||||
guint id;
|
|
||||||
if ((id = g_signal_lookup(signal, G_OBJECT_TYPE(widget))) != 0)
|
|
||||||
g_signal_emit(widget, id, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoCut(GtkWindow* window, WebContents* web_contents) {
|
|
||||||
DoCutCopyPaste(window, web_contents,
|
|
||||||
&RenderWidgetHost::Cut, "cut-clipboard");
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoCopy(GtkWindow* window, WebContents* web_contents) {
|
|
||||||
DoCutCopyPaste(window, web_contents,
|
|
||||||
&RenderWidgetHost::Copy, "copy-clipboard");
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoPaste(GtkWindow* window, WebContents* web_contents) {
|
|
||||||
DoCutCopyPaste(window, web_contents,
|
|
||||||
&RenderWidgetHost::Paste, "paste-clipboard");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ubuntu patches their version of GTK+ so that there is always a
|
// Ubuntu patches their version of GTK+ so that there is always a
|
||||||
// gripper in the bottom right corner of the window. We dynamically
|
// gripper in the bottom right corner of the window. We dynamically
|
||||||
// look up this symbol because it's a non-standard Ubuntu extension to
|
// look up this symbol because it's a non-standard Ubuntu extension to
|
||||||
|
|
|
@ -22,11 +22,6 @@ extern const int kFrameBorderThickness;
|
||||||
// the 16 px at the end of each edge triggers diagonal resizing.
|
// the 16 px at the end of each edge triggers diagonal resizing.
|
||||||
extern const int kResizeAreaCornerSize;
|
extern const int kResizeAreaCornerSize;
|
||||||
|
|
||||||
// Performs Cut/Copy/Paste operation on the |window|'s |web_contents|.
|
|
||||||
void DoCut(GtkWindow* window, content::WebContents* web_contents);
|
|
||||||
void DoCopy(GtkWindow* window, content::WebContents* web_contents);
|
|
||||||
void DoPaste(GtkWindow* window, content::WebContents* web_contents);
|
|
||||||
|
|
||||||
// Ubuntu patches their version of GTK+ to that there is always a
|
// Ubuntu patches their version of GTK+ to that there is always a
|
||||||
// gripper in the bottom right corner of the window. We always need to
|
// gripper in the bottom right corner of the window. We always need to
|
||||||
// disable this feature since we can't communicate this to WebKit easily.
|
// disable this feature since we can't communicate this to WebKit easily.
|
||||||
|
|
Loading…
Reference in a new issue