]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix compilation errors on Linux.
authorCheng Zhao <zcbenz@gmail.com>
Sun, 29 Jun 2014 01:51:02 +0000 (01:51 +0000)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 29 Jun 2014 01:51:02 +0000 (01:51 +0000)
atom/app/atom_main.cc
atom/browser/ui/gtk/app_indicator_icon.cc
chrome/browser/ui/gtk/gtk_window_util.cc
chrome/browser/ui/gtk/gtk_window_util.h

index d63d39bfe0089756cb4e0586695050158157a1a9..082913620b03d3d431306e9f765a96760fa70624 100644 (file)
@@ -98,7 +98,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
   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)
@@ -109,7 +109,7 @@ int main(int argc, const char* argv[]) {
     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)
index 1c88b29065b8f7e1dca3bcd299d4c4373476df03..4ab1dd3a398511d64c69bb8a0470904db0d72e41 100644 (file)
@@ -137,13 +137,12 @@ base::FilePath CreateTempImageFile(gfx::ImageSkia* image_ptr,
   // 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());
index 09d2624b5df28e5ad284ccddc4d350e65933055b..bce160a288df19ff4961ded0416515dc812069c2 100644 (file)
@@ -23,44 +23,6 @@ static guint32 last_click_time;
 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
index d4904ca8e947b68d82a9cf408c01a9e928b97171..a3e855cd7f378370cd36e8cfc34b85077695b794 100644 (file)
@@ -22,11 +22,6 @@ extern const int kFrameBorderThickness;
 // 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.