sandbox::SandboxInterfaceInfo sandbox_info = {0};
content::InitializeSandboxInfo(&sandbox_info);
atom::AtomMainDelegate delegate;
- return content::ContentMain(instance, &sandbox_info, &delegate);
+ return content::ContentMain(content::ContentMainParams(&delegate));
}
#elif defined(OS_LINUX) // defined(OS_WIN)
return node::Start(argc, const_cast<char**>(argv));
atom::AtomMainDelegate delegate;
- return content::ContentMain(argc, argv, &delegate);
+ return content::ContentMain(content::ContentMainParams(&delegate));
}
#else // defined(OS_LINUX)
// Create a new temporary directory for each image since using a single
// temporary directory seems to have issues when changing icons in quick
// succession.
- if (!file_util::CreateNewTempDirectory(base::FilePath::StringType(),
- &temp_dir))
+ if (!base::CreateNewTempDirectory(base::FilePath::StringType(), &temp_dir))
return base::FilePath();
new_file_path =
temp_dir.Append(id + base::StringPrintf("_%d.png", icon_change_count));
int bytes_written =
- file_util::WriteFile(
+ base::WriteFile(
new_file_path,
reinterpret_cast<const char*>(png_data->front()),
png_data->size());
static int last_click_x;
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
// gripper in the bottom right corner of the window. We dynamically
// look up this symbol because it's a non-standard Ubuntu extension to
// the 16 px at the end of each edge triggers diagonal resizing.
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
// 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.