Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Side by Side Diff: chrome/browser/ui/gtk/extensions/shell_window_gtk.cc

Issue 8985008: Don't use browser windows for platform app shell windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable platform app tests on non-GTK platforms. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/gtk/extensions/shell_window_gtk.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/gtk/extensions/shell_window_gtk.h"
6
7 #include "chrome/browser/extensions/extension_host.h"
8 #include "content/browser/renderer_host/render_widget_host_view_gtk.h"
9
10 ShellWindowGtk::ShellWindowGtk(ExtensionHost* host)
11 : ShellWindow(host) {
12 host_->view()->SetContainer(this);
13 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
14
15 gtk_container_add(GTK_CONTAINER(window_), host_->view()->native_view());
16
17 // TOOD(mihaip): Allow window dimensions to be specified in manifest (and
18 // restore prior window dimensions and positions on relaunch).
19 gtk_widget_set_size_request(GTK_WIDGET(window_), 512, 384);
20 gtk_window_set_decorated(window_, false);
21
22 g_signal_connect(window_, "delete-event",
23 G_CALLBACK(OnMainWindowDeleteEventThunk), this);
24
25 gtk_window_present(window_);
26 }
27
28 ShellWindowGtk::~ShellWindowGtk() {
29 }
30
31 void ShellWindowGtk::Close() {
32 gtk_widget_destroy(GTK_WIDGET(window_));
33 delete this;
34 }
35
36 // Callback for the delete event. This event is fired when the user tries to
37 // close the window (e.g., clicking on the X in the window manager title bar).
38 gboolean ShellWindowGtk::OnMainWindowDeleteEvent(GtkWidget* widget,
39 GdkEvent* event) {
40 Close();
41
42 // Return true to prevent the GTK window from being destroyed. Close will
43 // destroy it for us.
44 return TRUE;
45 }
46
47 // static
48 ShellWindow* ShellWindow::CreateShellWindow(ExtensionHost* host) {
49 return new ShellWindowGtk(host);
50 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/extensions/shell_window_gtk.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698