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 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 if (!GetBrowserWindowForNativeWindow(window)) | 1488 if (!GetBrowserWindowForNativeWindow(window)) |
1489 return NULL; | 1489 return NULL; |
1490 return window; | 1490 return window; |
1491 } | 1491 } |
1492 | 1492 |
1493 GtkWidget* BrowserWindowGtk::titlebar_widget() const { | 1493 GtkWidget* BrowserWindowGtk::titlebar_widget() const { |
1494 return titlebar_->widget(); | 1494 return titlebar_->widget(); |
1495 } | 1495 } |
1496 | 1496 |
1497 // static | 1497 // static |
1498 void BrowserWindowGtk::RegisterUserPrefs(PrefService* prefs) { | 1498 void BrowserWindowGtk::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
1499 bool custom_frame_default = false; | 1499 bool custom_frame_default = false; |
1500 // 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 |
1501 // is the case in Valgrind tests). | 1501 // is the case in Valgrind tests). |
1502 if (ui::XDisplayExists() && | 1502 if (ui::XDisplayExists() && |
1503 !prefs->HasPrefPath(prefs::kUseCustomChromeFrame)) { | 1503 !prefs->HasPrefPath(prefs::kUseCustomChromeFrame)) { |
1504 custom_frame_default = GetCustomFramePrefDefault(); | 1504 custom_frame_default = GetCustomFramePrefDefault(); |
1505 } | 1505 } |
1506 prefs->RegisterBooleanPref(prefs::kUseCustomChromeFrame, | 1506 prefs->RegisterBooleanPref(prefs::kUseCustomChromeFrame, |
1507 custom_frame_default, | 1507 custom_frame_default, |
1508 PrefService::SYNCABLE_PREF); | 1508 PrefServiceSyncable::SYNCABLE_PREF); |
1509 } | 1509 } |
1510 | 1510 |
1511 WebContents* BrowserWindowGtk::GetDisplayedTab() { | 1511 WebContents* BrowserWindowGtk::GetDisplayedTab() { |
1512 return contents_container_->GetVisibleTab(); | 1512 return contents_container_->GetVisibleTab(); |
1513 } | 1513 } |
1514 | 1514 |
1515 void BrowserWindowGtk::QueueToolbarRedraw() { | 1515 void BrowserWindowGtk::QueueToolbarRedraw() { |
1516 gtk_widget_queue_draw(toolbar_->widget()); | 1516 gtk_widget_queue_draw(toolbar_->widget()); |
1517 } | 1517 } |
1518 | 1518 |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2409 wm_type == ui::WM_OPENBOX || | 2409 wm_type == ui::WM_OPENBOX || |
2410 wm_type == ui::WM_XFWM4); | 2410 wm_type == ui::WM_XFWM4); |
2411 } | 2411 } |
2412 | 2412 |
2413 // static | 2413 // static |
2414 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2414 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2415 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2415 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2416 browser_window_gtk->Init(); | 2416 browser_window_gtk->Init(); |
2417 return browser_window_gtk; | 2417 return browser_window_gtk; |
2418 } | 2418 } |
OLD | NEW |