| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/gtk/browser_window_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 #include <X11/XF86keysym.h> | 8 #include <X11/XF86keysym.h> |
| 9 | 9 |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| 11 #include "app/theme_provider.h" | 11 #include "app/theme_provider.h" |
| 12 #include "base/base_paths_linux.h" | 12 #include "base/base_paths_linux.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/gfx/gtk_util.h" | 14 #include "base/gfx/gtk_util.h" |
| 15 #include "base/gfx/rect.h" |
| 15 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "base/message_loop.h" | 18 #include "base/message_loop.h" |
| 18 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/scoped_ptr.h" |
| 19 #include "base/string_util.h" | 21 #include "base/string_util.h" |
| 20 #include "base/time.h" | 22 #include "base/time.h" |
| 21 #include "chrome/app/chrome_dll_resource.h" | 23 #include "chrome/app/chrome_dll_resource.h" |
| 22 #include "chrome/browser/bookmarks/bookmark_utils.h" | 24 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 23 #include "chrome/browser/browser.h" | 25 #include "chrome/browser/browser.h" |
| 24 #include "chrome/browser/browser_list.h" | 26 #include "chrome/browser/browser_list.h" |
| 25 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
| 26 #include "chrome/browser/browser_theme_provider.h" | 28 #include "chrome/browser/browser_theme_provider.h" |
| 27 #include "chrome/browser/debugger/devtools_window.h" | 29 #include "chrome/browser/debugger/devtools_window.h" |
| 28 #include "chrome/browser/download/download_item_model.h" | 30 #include "chrome/browser/download/download_item_model.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 47 #include "chrome/browser/gtk/nine_box.h" | 49 #include "chrome/browser/gtk/nine_box.h" |
| 48 #include "chrome/browser/gtk/status_bubble_gtk.h" | 50 #include "chrome/browser/gtk/status_bubble_gtk.h" |
| 49 #include "chrome/browser/gtk/tab_contents_container_gtk.h" | 51 #include "chrome/browser/gtk/tab_contents_container_gtk.h" |
| 50 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" | 52 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" |
| 51 #include "chrome/browser/gtk/task_manager_gtk.h" | 53 #include "chrome/browser/gtk/task_manager_gtk.h" |
| 52 #include "chrome/browser/gtk/toolbar_star_toggle_gtk.h" | 54 #include "chrome/browser/gtk/toolbar_star_toggle_gtk.h" |
| 53 #include "chrome/browser/location_bar.h" | 55 #include "chrome/browser/location_bar.h" |
| 54 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" | 56 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" |
| 55 #include "chrome/browser/tab_contents/tab_contents.h" | 57 #include "chrome/browser/tab_contents/tab_contents.h" |
| 56 #include "chrome/browser/tab_contents/tab_contents_view.h" | 58 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 59 #include "chrome/browser/window_sizer.h" |
| 57 #include "chrome/common/gtk_util.h" | 60 #include "chrome/common/gtk_util.h" |
| 58 #include "chrome/common/notification_service.h" | 61 #include "chrome/common/notification_service.h" |
| 59 #include "chrome/common/pref_names.h" | 62 #include "chrome/common/pref_names.h" |
| 60 #include "chrome/common/pref_service.h" | 63 #include "chrome/common/pref_service.h" |
| 61 #include "grit/app_resources.h" | 64 #include "grit/app_resources.h" |
| 62 #include "grit/theme_resources.h" | 65 #include "grit/theme_resources.h" |
| 63 | 66 |
| 64 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
| 65 #include "chrome/browser/views/panel_controller.h" | 68 #include "chrome/browser/views/panel_controller.h" |
| 66 #include "chrome/browser/views/tabs/tab_overview_types.h" | 69 #include "chrome/browser/views/tabs/tab_overview_types.h" |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 g_browser_process->local_state()->GetMutableDictionary( | 1301 g_browser_process->local_state()->GetMutableDictionary( |
| 1299 window_name.c_str()); | 1302 window_name.c_str()); |
| 1300 // Note that we store left/top for consistency with Windows, but that we | 1303 // Note that we store left/top for consistency with Windows, but that we |
| 1301 // *don't* obey them; we only use them for computing width/height. See | 1304 // *don't* obey them; we only use them for computing width/height. See |
| 1302 // comments in SetGeometryHints(). | 1305 // comments in SetGeometryHints(). |
| 1303 window_preferences->SetInteger(L"left", restored_bounds_.x()); | 1306 window_preferences->SetInteger(L"left", restored_bounds_.x()); |
| 1304 window_preferences->SetInteger(L"top", restored_bounds_.y()); | 1307 window_preferences->SetInteger(L"top", restored_bounds_.y()); |
| 1305 window_preferences->SetInteger(L"right", restored_bounds_.right()); | 1308 window_preferences->SetInteger(L"right", restored_bounds_.right()); |
| 1306 window_preferences->SetInteger(L"bottom", restored_bounds_.bottom()); | 1309 window_preferences->SetInteger(L"bottom", restored_bounds_.bottom()); |
| 1307 window_preferences->SetBoolean(L"maximized", IsMaximized()); | 1310 window_preferences->SetBoolean(L"maximized", IsMaximized()); |
| 1311 |
| 1312 scoped_ptr<WindowSizer::MonitorInfoProvider> monitor_info_provider( |
| 1313 WindowSizer::CreateDefaultMonitorInfoProvider()); |
| 1314 gfx::Rect work_area( |
| 1315 monitor_info_provider->GetMonitorWorkAreaMatching(restored_bounds_)); |
| 1316 window_preferences->SetInteger(L"work_area_left", work_area.x()); |
| 1317 window_preferences->SetInteger(L"work_area_top", work_area.y()); |
| 1318 window_preferences->SetInteger(L"work_area_right", work_area.right()); |
| 1319 window_preferences->SetInteger(L"work_area_bottom", work_area.bottom()); |
| 1308 } | 1320 } |
| 1309 | 1321 |
| 1310 // static | 1322 // static |
| 1311 gboolean BrowserWindowGtk::OnGtkAccelerator(GtkAccelGroup* accel_group, | 1323 gboolean BrowserWindowGtk::OnGtkAccelerator(GtkAccelGroup* accel_group, |
| 1312 GObject* acceleratable, | 1324 GObject* acceleratable, |
| 1313 guint keyval, | 1325 guint keyval, |
| 1314 GdkModifierType modifier, | 1326 GdkModifierType modifier, |
| 1315 BrowserWindowGtk* browser_window) { | 1327 BrowserWindowGtk* browser_window) { |
| 1316 int command_id = GetCommandId(keyval, modifier); | 1328 int command_id = GetCommandId(keyval, modifier); |
| 1317 browser_window->ExecuteBrowserCommand(command_id); | 1329 browser_window->ExecuteBrowserCommand(command_id); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 *edge = GDK_WINDOW_EDGE_NORTH_EAST; | 1544 *edge = GDK_WINDOW_EDGE_NORTH_EAST; |
| 1533 } else if (y < bounds_.height() - kResizeAreaCornerSize) { | 1545 } else if (y < bounds_.height() - kResizeAreaCornerSize) { |
| 1534 *edge = GDK_WINDOW_EDGE_EAST; | 1546 *edge = GDK_WINDOW_EDGE_EAST; |
| 1535 } else { | 1547 } else { |
| 1536 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; | 1548 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; |
| 1537 } | 1549 } |
| 1538 return true; | 1550 return true; |
| 1539 } | 1551 } |
| 1540 NOTREACHED(); | 1552 NOTREACHED(); |
| 1541 } | 1553 } |
| OLD | NEW |