~justinmcp/unity-chromium-extension/native-messaging-base

« back to all changes in this revision

Viewing changes to chromium-patches/stable-24.0.1312.52/3-chrome-xid.patch

  • Committer: CI bot
  • Author(s): Justin McPherson
  • Date: 2014-02-17 23:43:23 UTC
  • mfrom: (239.2.1 remove-patches)
  • Revision ID: ps-jenkins@lists.canonical.com-20140217234323-4pw656wfrooeinde
Chromium patches are no longer maintained in this repo, remove them to avoid confusion. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: src/chrome/browser/ui/gtk/browser_window_gtk.cc
2
 
===================================================================
3
 
--- src/chrome/browser/ui/gtk/browser_window_gtk.cc     (revision 165188)
4
 
+++ src/chrome/browser/ui/gtk/browser_window_gtk.cc     (working copy)
5
 
@@ -148,6 +148,12 @@
6
 
 // gtk_window_get_position() after the last GTK configure-event signal.
7
 
 const int kDebounceTimeoutMilliseconds = 100;
8
 
 
9
 
+// A window property will be set to reflect the session_id of the
10
 
+//  associated browser window. The session_id is unique among browsers
11
 
+//  for a given session and actually corresponds to the window.id found
12
 
+//  in the extensions api.
13
 
+char kSessionIdPropertyName[] = "CHROMIUM_LINUX_SESSION_ID_PROPERTY";
14
 
+
15
 
 // Using gtk_window_get_position/size creates a race condition, so only use
16
 
 // this to get the initial bounds.  After window creation, we pick up the
17
 
 // normal bounds by connecting to the configure-event signal.
18
 
@@ -320,6 +326,20 @@
19
 
     InitWidgets();
20
 
   }
21
 
 
22
 
+  // Add a specific property to inform an interested third party
23
 
+  //  of our session id. Interesting in the context of an extension
24
 
+  //  where the session id corresponds to the window.id and is a way
25
 
+  //  to uniquely identify a window based on that (from within a given
26
 
+  //  extension).
27
 
+  gulong session_id = browser_->session_id().id();
28
 
+  gdk_property_change(GTK_WIDGET(window_)->window,
29
 
+                      gdk_atom_intern(kSessionIdPropertyName, FALSE),
30
 
+                     gdk_atom_intern("CARDINAL", FALSE),
31
 
+                     32,
32
 
+                     GDK_PROP_MODE_REPLACE,
33
 
+                     (guchar *)&session_id,
34
 
+                     1);
35
 
+
36
 
   ConnectAccelerators();
37
 
 
38
 
   // Set the initial background color of widgets.