OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 if (!GetBrowserWindowForNativeWindow(window)) | 1487 if (!GetBrowserWindowForNativeWindow(window)) |
1488 return NULL; | 1488 return NULL; |
1489 return window; | 1489 return window; |
1490 } | 1490 } |
1491 | 1491 |
1492 GtkWidget* BrowserWindowGtk::titlebar_widget() const { | 1492 GtkWidget* BrowserWindowGtk::titlebar_widget() const { |
1493 return titlebar_->widget(); | 1493 return titlebar_->widget(); |
1494 } | 1494 } |
1495 | 1495 |
1496 // static | 1496 // static |
1497 void BrowserWindowGtk::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 1497 void BrowserWindowGtk::RegisterUserPrefs( |
| 1498 user_prefs::PrefRegistrySyncable* registry) { |
1498 bool custom_frame_default = false; | 1499 bool custom_frame_default = false; |
1499 // Avoid checking the window manager if we're not connected to an X server (as | 1500 // Avoid checking the window manager if we're not connected to an X server (as |
1500 // is the case in Valgrind tests). | 1501 // is the case in Valgrind tests). |
1501 if (ui::XDisplayExists()) | 1502 if (ui::XDisplayExists()) |
1502 custom_frame_default = GetCustomFramePrefDefault(); | 1503 custom_frame_default = GetCustomFramePrefDefault(); |
1503 | 1504 |
1504 registry->RegisterBooleanPref(prefs::kUseCustomChromeFrame, | 1505 registry->RegisterBooleanPref( |
1505 custom_frame_default, | 1506 prefs::kUseCustomChromeFrame, |
1506 PrefRegistrySyncable::UNSYNCABLE_PREF); | 1507 custom_frame_default, |
| 1508 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
1507 } | 1509 } |
1508 | 1510 |
1509 WebContents* BrowserWindowGtk::GetDisplayedTab() { | 1511 WebContents* BrowserWindowGtk::GetDisplayedTab() { |
1510 return contents_container_->GetVisibleTab(); | 1512 return contents_container_->GetVisibleTab(); |
1511 } | 1513 } |
1512 | 1514 |
1513 void BrowserWindowGtk::QueueToolbarRedraw() { | 1515 void BrowserWindowGtk::QueueToolbarRedraw() { |
1514 gtk_widget_queue_draw(toolbar_->widget()); | 1516 gtk_widget_queue_draw(toolbar_->widget()); |
1515 } | 1517 } |
1516 | 1518 |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2394 wm_type == ui::WM_OPENBOX || | 2396 wm_type == ui::WM_OPENBOX || |
2395 wm_type == ui::WM_XFWM4); | 2397 wm_type == ui::WM_XFWM4); |
2396 } | 2398 } |
2397 | 2399 |
2398 // static | 2400 // static |
2399 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2401 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2400 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2402 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2401 browser_window_gtk->Init(); | 2403 browser_window_gtk->Init(); |
2402 return browser_window_gtk; | 2404 return browser_window_gtk; |
2403 } | 2405 } |
OLD | NEW |