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 11 matching lines...) Expand all Loading... | |
22 #include "base/nix/xdg_util.h" | 22 #include "base/nix/xdg_util.h" |
23 #include "base/path_service.h" | 23 #include "base/path_service.h" |
24 #include "base/string_util.h" | 24 #include "base/string_util.h" |
25 #include "base/time.h" | 25 #include "base/time.h" |
26 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
27 #include "chrome/app/chrome_command_ids.h" | 27 #include "chrome/app/chrome_command_ids.h" |
28 #include "chrome/browser/api/infobars/infobar_service.h" | 28 #include "chrome/browser/api/infobars/infobar_service.h" |
29 #include "chrome/browser/browser_process.h" | 29 #include "chrome/browser/browser_process.h" |
30 #include "chrome/browser/download/download_item_model.h" | 30 #include "chrome/browser/download/download_item_model.h" |
31 #include "chrome/browser/extensions/tab_helper.h" | 31 #include "chrome/browser/extensions/tab_helper.h" |
32 #include "chrome/browser/prefs/pref_registry_syncable.h" | |
32 #include "chrome/browser/prefs/pref_service.h" | 33 #include "chrome/browser/prefs/pref_service.h" |
33 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 34 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
34 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
35 #include "chrome/browser/themes/theme_service.h" | 36 #include "chrome/browser/themes/theme_service.h" |
36 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 37 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
37 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 38 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
38 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 39 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
39 #include "chrome/browser/ui/browser.h" | 40 #include "chrome/browser/ui/browser.h" |
40 #include "chrome/browser/ui/browser_command_controller.h" | 41 #include "chrome/browser/ui/browser_command_controller.h" |
41 #include "chrome/browser/ui/browser_commands.h" | 42 #include "chrome/browser/ui/browser_commands.h" |
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1478 if (!GetBrowserWindowForNativeWindow(window)) | 1479 if (!GetBrowserWindowForNativeWindow(window)) |
1479 return NULL; | 1480 return NULL; |
1480 return window; | 1481 return window; |
1481 } | 1482 } |
1482 | 1483 |
1483 GtkWidget* BrowserWindowGtk::titlebar_widget() const { | 1484 GtkWidget* BrowserWindowGtk::titlebar_widget() const { |
1484 return titlebar_->widget(); | 1485 return titlebar_->widget(); |
1485 } | 1486 } |
1486 | 1487 |
1487 // static | 1488 // static |
1488 void BrowserWindowGtk::RegisterUserPrefs(PrefServiceSyncable* prefs) { | 1489 void BrowserWindowGtk::RegisterUserPrefs(PrefService* prefs, |
1490 PrefRegistrySyncable* registry) { | |
1489 bool custom_frame_default = false; | 1491 bool custom_frame_default = false; |
1490 // Avoid checking the window manager if we're not connected to an X server (as | 1492 // Avoid checking the window manager if we're not connected to an X server (as |
1491 // is the case in Valgrind tests). | 1493 // is the case in Valgrind tests). |
Mattias Nissler (ping if slow)
2013/02/06 17:53:33
TODO remove prefs parameter.
Jói
2013/02/07 14:52:32
Done.
| |
1492 if (ui::XDisplayExists() && | 1494 if (ui::XDisplayExists() && |
1493 !prefs->HasPrefPath(prefs::kUseCustomChromeFrame)) { | 1495 !prefs->HasPrefPath(prefs::kUseCustomChromeFrame)) { |
1494 custom_frame_default = GetCustomFramePrefDefault(); | 1496 custom_frame_default = GetCustomFramePrefDefault(); |
1495 } | 1497 } |
1496 prefs->RegisterBooleanPref(prefs::kUseCustomChromeFrame, | 1498 registry->RegisterBooleanPref(prefs::kUseCustomChromeFrame, |
1497 custom_frame_default, | 1499 custom_frame_default, |
1498 PrefServiceSyncable::UNSYNCABLE_PREF); | 1500 PrefRegistrySyncable::UNSYNCABLE_PREF); |
1499 } | 1501 } |
1500 | 1502 |
1501 WebContents* BrowserWindowGtk::GetDisplayedTab() { | 1503 WebContents* BrowserWindowGtk::GetDisplayedTab() { |
1502 return contents_container_->GetVisibleTab(); | 1504 return contents_container_->GetVisibleTab(); |
1503 } | 1505 } |
1504 | 1506 |
1505 void BrowserWindowGtk::QueueToolbarRedraw() { | 1507 void BrowserWindowGtk::QueueToolbarRedraw() { |
1506 gtk_widget_queue_draw(toolbar_->widget()); | 1508 gtk_widget_queue_draw(toolbar_->widget()); |
1507 } | 1509 } |
1508 | 1510 |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2406 wm_type == ui::WM_OPENBOX || | 2408 wm_type == ui::WM_OPENBOX || |
2407 wm_type == ui::WM_XFWM4); | 2409 wm_type == ui::WM_XFWM4); |
2408 } | 2410 } |
2409 | 2411 |
2410 // static | 2412 // static |
2411 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2413 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2412 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2414 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2413 browser_window_gtk->Init(); | 2415 browser_window_gtk->Init(); |
2414 return browser_window_gtk; | 2416 return browser_window_gtk; |
2415 } | 2417 } |
OLD | NEW |