OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #include <string> | 10 #include <string> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 #include "chrome/browser/ui/window_sizer.h" | 77 #include "chrome/browser/ui/window_sizer.h" |
78 #include "chrome/browser/web_applications/web_app.h" | 78 #include "chrome/browser/web_applications/web_app.h" |
79 #include "chrome/common/chrome_notification_types.h" | 79 #include "chrome/common/chrome_notification_types.h" |
80 #include "chrome/common/chrome_switches.h" | 80 #include "chrome/common/chrome_switches.h" |
81 #include "chrome/common/pref_names.h" | 81 #include "chrome/common/pref_names.h" |
82 #include "content/browser/download/download_manager.h" | 82 #include "content/browser/download/download_manager.h" |
83 #include "content/browser/renderer_host/render_view_host.h" | 83 #include "content/browser/renderer_host/render_view_host.h" |
84 #include "content/browser/renderer_host/render_widget_host_view.h" | 84 #include "content/browser/renderer_host/render_widget_host_view.h" |
85 #include "content/browser/tab_contents/tab_contents.h" | 85 #include "content/browser/tab_contents/tab_contents.h" |
86 #include "content/browser/tab_contents/tab_contents_view.h" | 86 #include "content/browser/tab_contents/tab_contents_view.h" |
87 #include "content/common/notification_service.h" | 87 #include "content/public/browser/notification_service.h" |
88 #include "content/public/browser/native_web_keyboard_event.h" | 88 #include "content/public/browser/native_web_keyboard_event.h" |
89 #include "grit/chromium_strings.h" | 89 #include "grit/chromium_strings.h" |
90 #include "grit/generated_resources.h" | 90 #include "grit/generated_resources.h" |
91 #include "grit/theme_resources.h" | 91 #include "grit/theme_resources.h" |
92 #include "grit/theme_resources_standard.h" | 92 #include "grit/theme_resources_standard.h" |
93 #include "grit/ui_resources.h" | 93 #include "grit/ui_resources.h" |
94 #include "ui/base/gtk/gtk_floating_container.h" | 94 #include "ui/base/gtk/gtk_floating_container.h" |
95 #include "ui/base/gtk/gtk_hig_constants.h" | 95 #include "ui/base/gtk/gtk_hig_constants.h" |
96 #include "ui/base/keycodes/keyboard_codes.h" | 96 #include "ui/base/keycodes/keyboard_codes.h" |
97 #include "ui/base/l10n/l10n_util.h" | 97 #include "ui/base/l10n/l10n_util.h" |
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 if (!browser_->tabstrip_model()->empty()) { | 1522 if (!browser_->tabstrip_model()->empty()) { |
1523 // Tab strip isn't empty. Hide the window (so it appears to have closed | 1523 // Tab strip isn't empty. Hide the window (so it appears to have closed |
1524 // immediately) and close all the tabs, allowing the renderers to shut | 1524 // immediately) and close all the tabs, allowing the renderers to shut |
1525 // down. When the tab strip is empty we'll be called back again. | 1525 // down. When the tab strip is empty we'll be called back again. |
1526 gtk_widget_hide(GTK_WIDGET(window_)); | 1526 gtk_widget_hide(GTK_WIDGET(window_)); |
1527 browser_->OnWindowClosing(); | 1527 browser_->OnWindowClosing(); |
1528 return false; | 1528 return false; |
1529 } | 1529 } |
1530 | 1530 |
1531 // Empty TabStripModel, it's now safe to allow the Window to be closed. | 1531 // Empty TabStripModel, it's now safe to allow the Window to be closed. |
1532 NotificationService::current()->Notify( | 1532 content::NotificationService::current()->Notify( |
1533 chrome::NOTIFICATION_WINDOW_CLOSED, | 1533 chrome::NOTIFICATION_WINDOW_CLOSED, |
1534 content::Source<GtkWindow>(window_), | 1534 content::Source<GtkWindow>(window_), |
1535 NotificationService::NoDetails()); | 1535 content::NotificationService::NoDetails()); |
1536 return true; | 1536 return true; |
1537 } | 1537 } |
1538 | 1538 |
1539 bool BrowserWindowGtk::ShouldShowWindowIcon() const { | 1539 bool BrowserWindowGtk::ShouldShowWindowIcon() const { |
1540 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); | 1540 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); |
1541 } | 1541 } |
1542 | 1542 |
1543 void BrowserWindowGtk::DisableDebounceTimerForTests(bool is_disabled) { | 1543 void BrowserWindowGtk::DisableDebounceTimerForTests(bool is_disabled) { |
1544 debounce_timer_disabled_ = is_disabled; | 1544 debounce_timer_disabled_ = is_disabled; |
1545 if (is_disabled) | 1545 if (is_disabled) |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2407 wm_name == "Openbox" || | 2407 wm_name == "Openbox" || |
2408 wm_name == "Xfwm4"); | 2408 wm_name == "Xfwm4"); |
2409 } | 2409 } |
2410 | 2410 |
2411 // static | 2411 // static |
2412 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2412 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2413 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2413 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2414 browser_window_gtk->Init(); | 2414 browser_window_gtk->Init(); |
2415 return browser_window_gtk; | 2415 return browser_window_gtk; |
2416 } | 2416 } |
OLD | NEW |