OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 | 112 |
113 using content::NativeWebKeyboardEvent; | 113 using content::NativeWebKeyboardEvent; |
114 using content::SSLStatus; | 114 using content::SSLStatus; |
115 using content::WebContents; | 115 using content::WebContents; |
116 | 116 |
117 namespace { | 117 namespace { |
118 | 118 |
119 // The number of milliseconds between loading animation frames. | 119 // The number of milliseconds between loading animation frames. |
120 const int kLoadingAnimationFrameTimeMs = 30; | 120 const int kLoadingAnimationFrameTimeMs = 30; |
121 | 121 |
122 // Minimal height of devotools pane or content pane when devtools are docked | |
123 // to the browser window. | |
124 const int kMinDevToolsHeight = 50; | |
125 const int kMinDevToolsWidth = 150; | |
126 const int kMinContentsSize = 50; | |
127 | |
128 const char* kBrowserWindowKey = "__BROWSER_WINDOW_GTK__"; | 122 const char* kBrowserWindowKey = "__BROWSER_WINDOW_GTK__"; |
129 | 123 |
130 // The frame border is only visible in restored mode and is hardcoded to 4 px | 124 // The frame border is only visible in restored mode and is hardcoded to 4 px |
131 // on each side regardless of the system window border size. | 125 // on each side regardless of the system window border size. |
132 const int kFrameBorderThickness = 4; | 126 const int kFrameBorderThickness = 4; |
133 // While resize areas on Windows are normally the same size as the window | 127 // While resize areas on Windows are normally the same size as the window |
134 // borders, our top area is shrunk by 1 px to make it easier to move the window | 128 // borders, our top area is shrunk by 1 px to make it easier to move the window |
135 // around with our thinner top grabbable strip. (Incidentally, our side and | 129 // around with our thinner top grabbable strip. (Incidentally, our side and |
136 // bottom resize areas don't match the frame border thickness either -- they | 130 // bottom resize areas don't match the frame border thickness either -- they |
137 // span the whole nonclient area, so there's no "dead zone" for the mouse.) | 131 // span the whole nonclient area, so there's no "dead zone" for the mouse.) |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 : window_(NULL), | 225 : window_(NULL), |
232 window_container_(NULL), | 226 window_container_(NULL), |
233 window_vbox_(NULL), | 227 window_vbox_(NULL), |
234 render_area_vbox_(NULL), | 228 render_area_vbox_(NULL), |
235 render_area_floating_container_(NULL), | 229 render_area_floating_container_(NULL), |
236 render_area_event_box_(NULL), | 230 render_area_event_box_(NULL), |
237 toolbar_border_(NULL), | 231 toolbar_border_(NULL), |
238 browser_(browser), | 232 browser_(browser), |
239 state_(GDK_WINDOW_STATE_WITHDRAWN), | 233 state_(GDK_WINDOW_STATE_WITHDRAWN), |
240 devtools_dock_side_(DEVTOOLS_DOCK_SIDE_BOTTOM), | 234 devtools_dock_side_(DEVTOOLS_DOCK_SIDE_BOTTOM), |
235 devtools_window_(NULL), | |
241 contents_hsplit_(NULL), | 236 contents_hsplit_(NULL), |
242 contents_vsplit_(NULL), | 237 contents_vsplit_(NULL), |
243 frame_cursor_(NULL), | 238 frame_cursor_(NULL), |
244 is_active_(false), | 239 is_active_(false), |
245 show_state_after_show_(ui::SHOW_STATE_DEFAULT), | 240 show_state_after_show_(ui::SHOW_STATE_DEFAULT), |
246 suppress_window_raise_(false), | 241 suppress_window_raise_(false), |
247 accel_group_(NULL), | 242 accel_group_(NULL), |
248 fullscreen_exit_bubble_type_( | 243 fullscreen_exit_bubble_type_( |
249 FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION) { | 244 FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION) { |
250 } | 245 } |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
730 | 725 |
731 void BrowserWindowGtk::BookmarkBarStateChanged( | 726 void BrowserWindowGtk::BookmarkBarStateChanged( |
732 BookmarkBar::AnimateChangeType change_type) { | 727 BookmarkBar::AnimateChangeType change_type) { |
733 MaybeShowBookmarkBar(change_type == BookmarkBar::ANIMATE_STATE_CHANGE); | 728 MaybeShowBookmarkBar(change_type == BookmarkBar::ANIMATE_STATE_CHANGE); |
734 } | 729 } |
735 | 730 |
736 void BrowserWindowGtk::UpdateDevTools() { | 731 void BrowserWindowGtk::UpdateDevTools() { |
737 UpdateDevToolsForContents(chrome::GetActiveWebContents(browser_.get())); | 732 UpdateDevToolsForContents(chrome::GetActiveWebContents(browser_.get())); |
738 } | 733 } |
739 | 734 |
740 void BrowserWindowGtk::SetDevToolsDockSide(DevToolsDockSide side) { | |
741 if (devtools_dock_side_ == side) | |
742 return; | |
743 | |
744 if (devtools_container_->tab()) { | |
745 HideDevToolsContainer(); | |
746 ShowDevToolsContainer(side); | |
747 } else { | |
748 devtools_dock_side_ = side; | |
749 } | |
750 } | |
751 | |
752 void BrowserWindowGtk::UpdateLoadingAnimations(bool should_animate) { | 735 void BrowserWindowGtk::UpdateLoadingAnimations(bool should_animate) { |
753 if (should_animate) { | 736 if (should_animate) { |
754 if (!loading_animation_timer_.IsRunning()) { | 737 if (!loading_animation_timer_.IsRunning()) { |
755 // Loads are happening, and the timer isn't running, so start it. | 738 // Loads are happening, and the timer isn't running, so start it. |
756 loading_animation_timer_.Start(FROM_HERE, | 739 loading_animation_timer_.Start(FROM_HERE, |
757 base::TimeDelta::FromMilliseconds(kLoadingAnimationFrameTimeMs), this, | 740 base::TimeDelta::FromMilliseconds(kLoadingAnimationFrameTimeMs), this, |
758 &BrowserWindowGtk::LoadingAnimationCallback); | 741 &BrowserWindowGtk::LoadingAnimationCallback); |
759 } | 742 } |
760 } else { | 743 } else { |
761 if (loading_animation_timer_.IsRunning()) { | 744 if (loading_animation_timer_.IsRunning()) { |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1308 | 1291 |
1309 extensions::ActiveTabPermissionGranter* | 1292 extensions::ActiveTabPermissionGranter* |
1310 BrowserWindowGtk::GetActiveTabPermissionGranter() { | 1293 BrowserWindowGtk::GetActiveTabPermissionGranter() { |
1311 TabContents* tab = GetDisplayedTab(); | 1294 TabContents* tab = GetDisplayedTab(); |
1312 if (!tab) | 1295 if (!tab) |
1313 return NULL; | 1296 return NULL; |
1314 return extensions::TabHelper::FromWebContents(tab->web_contents())-> | 1297 return extensions::TabHelper::FromWebContents(tab->web_contents())-> |
1315 active_tab_permission_granter(); | 1298 active_tab_permission_granter(); |
1316 } | 1299 } |
1317 | 1300 |
1318 void BrowserWindowGtk::UpdateDevToolsForContents(WebContents* contents) { | |
1319 TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::UpdateDevToolsForContents"); | |
1320 TabContents* old_devtools = devtools_container_->tab(); | |
1321 DevToolsWindow* devtools_window = contents ? | |
1322 DevToolsWindow::GetDockedInstanceForInspectedTab(contents) : NULL; | |
1323 TabContents* devtools_contents = | |
1324 devtools_window ? devtools_window->tab_contents() : NULL; | |
1325 | |
1326 if (old_devtools == devtools_contents) { | |
1327 if (devtools_contents && | |
1328 devtools_window->dock_side() != devtools_dock_side_) | |
1329 SetDevToolsDockSide(devtools_window->dock_side()); | |
1330 return; | |
1331 } | |
1332 | |
1333 if (old_devtools) | |
1334 devtools_container_->DetachTab(old_devtools); | |
1335 | |
1336 devtools_container_->SetTab(devtools_contents); | |
1337 if (devtools_contents) { | |
1338 // WebContentsViewGtk::WasShown is not called when tab contents is shown by | |
1339 // anything other than user selecting a Tab. | |
1340 // See TabContentsViewViews::OnWindowPosChanged for reference on how it | |
1341 // should be implemented. | |
1342 devtools_contents->web_contents()->WasShown(); | |
1343 } | |
1344 | |
1345 bool should_show = old_devtools == NULL && devtools_contents != NULL; | |
1346 bool should_hide = old_devtools != NULL && devtools_contents == NULL; | |
1347 | |
1348 if (should_show) | |
1349 ShowDevToolsContainer(devtools_window->dock_side()); | |
1350 else if (should_hide) | |
1351 HideDevToolsContainer(); | |
1352 } | |
1353 | |
1354 void BrowserWindowGtk::ShowDevToolsContainer(DevToolsDockSide dock_side) { | |
1355 devtools_dock_side_ = dock_side; | |
1356 bool dock_to_right = dock_side == DEVTOOLS_DOCK_SIDE_RIGHT; | |
1357 | |
1358 GtkAllocation contents_rect; | |
1359 gtk_widget_get_allocation(contents_vsplit_, &contents_rect); | |
1360 int content_size = | |
1361 dock_to_right ? contents_rect.width : contents_rect.height; | |
1362 | |
1363 int split_offset = browser_->profile()->GetPrefs()-> | |
1364 GetInteger(dock_to_right ? prefs::kDevToolsVSplitLocation : | |
1365 prefs::kDevToolsHSplitLocation); | |
1366 int min_size = | |
1367 dock_to_right ? kMinDevToolsWidth : kMinDevToolsHeight; | |
1368 | |
1369 if (split_offset == -1) | |
1370 split_offset = content_size * 1 / 3; | |
1371 // Make sure user can see both panes. | |
1372 split_offset = std::max(min_size, split_offset); | |
1373 split_offset = std::min(content_size - kMinContentsSize, split_offset); | |
1374 if (split_offset < 0) | |
1375 split_offset = content_size * 1 / 3; | |
1376 if (dock_to_right) { | |
1377 gtk_paned_pack2(GTK_PANED(contents_hsplit_), devtools_container_->widget(), | |
1378 FALSE, TRUE); | |
1379 gtk_paned_set_position(GTK_PANED(contents_hsplit_), | |
1380 content_size - split_offset); | |
1381 } else { | |
1382 gtk_paned_pack2(GTK_PANED(contents_vsplit_), devtools_container_->widget(), | |
1383 FALSE, TRUE); | |
1384 gtk_paned_set_position(GTK_PANED(contents_vsplit_), | |
1385 content_size - split_offset); | |
1386 } | |
1387 gtk_widget_show(devtools_container_->widget()); | |
1388 } | |
1389 | |
1390 void BrowserWindowGtk::HideDevToolsContainer() { | |
1391 GtkAllocation contents_rect; | |
1392 gtk_widget_get_allocation(contents_vsplit_, &contents_rect); | |
1393 bool dock_to_right = devtools_dock_side_ == DEVTOOLS_DOCK_SIDE_RIGHT; | |
1394 gint split_offset; | |
1395 if (dock_to_right) { | |
1396 split_offset = contents_rect.width - | |
1397 gtk_paned_get_position(GTK_PANED(contents_hsplit_)); | |
1398 gtk_container_remove(GTK_CONTAINER(contents_hsplit_), | |
1399 devtools_container_->widget()); | |
1400 } else { | |
1401 split_offset = contents_rect.height - | |
1402 gtk_paned_get_position(GTK_PANED(contents_vsplit_)); | |
1403 gtk_container_remove(GTK_CONTAINER(contents_vsplit_), | |
1404 devtools_container_->widget()); | |
1405 } | |
1406 | |
1407 browser_->profile()->GetPrefs()-> | |
1408 SetInteger(dock_to_right ? prefs::kDevToolsVSplitLocation : | |
1409 prefs::kDevToolsHSplitLocation, | |
1410 split_offset); | |
1411 } | |
1412 | |
1413 void BrowserWindowGtk::DestroyBrowser() { | 1301 void BrowserWindowGtk::DestroyBrowser() { |
1414 browser_.reset(); | 1302 browser_.reset(); |
1415 } | 1303 } |
1416 | 1304 |
1417 gboolean BrowserWindowGtk::OnConfigure(GtkWidget* widget, | 1305 gboolean BrowserWindowGtk::OnConfigure(GtkWidget* widget, |
1418 GdkEventConfigure* event) { | 1306 GdkEventConfigure* event) { |
1419 gfx::Rect bounds(event->x, event->y, event->width, event->height); | 1307 gfx::Rect bounds(event->x, event->y, event->width, event->height); |
1420 | 1308 |
1421 // When the window moves, we'll get multiple configure-event signals. We can | 1309 // When the window moves, we'll get multiple configure-event signals. We can |
1422 // also get events when the bounds haven't changed, but the window's stacking | 1310 // also get events when the bounds haven't changed, but the window's stacking |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1771 | 1659 |
1772 status_bubble_.reset(new StatusBubbleGtk(browser_->profile())); | 1660 status_bubble_.reset(new StatusBubbleGtk(browser_->profile())); |
1773 | 1661 |
1774 contents_container_.reset(new TabContentsContainerGtk(status_bubble_.get())); | 1662 contents_container_.reset(new TabContentsContainerGtk(status_bubble_.get())); |
1775 devtools_container_.reset(new TabContentsContainerGtk(NULL)); | 1663 devtools_container_.reset(new TabContentsContainerGtk(NULL)); |
1776 ViewIDUtil::SetID(devtools_container_->widget(), VIEW_ID_DEV_TOOLS_DOCKED); | 1664 ViewIDUtil::SetID(devtools_container_->widget(), VIEW_ID_DEV_TOOLS_DOCKED); |
1777 | 1665 |
1778 contents_hsplit_ = gtk_hpaned_new(); | 1666 contents_hsplit_ = gtk_hpaned_new(); |
1779 gtk_paned_pack1(GTK_PANED(contents_hsplit_), contents_container_->widget(), | 1667 gtk_paned_pack1(GTK_PANED(contents_hsplit_), contents_container_->widget(), |
1780 TRUE, TRUE); | 1668 TRUE, TRUE); |
1781 | |
1782 contents_vsplit_ = gtk_vpaned_new(); | 1669 contents_vsplit_ = gtk_vpaned_new(); |
1783 gtk_paned_pack1(GTK_PANED(contents_vsplit_), contents_hsplit_, TRUE, TRUE); | 1670 gtk_paned_pack1(GTK_PANED(contents_vsplit_), contents_hsplit_, TRUE, TRUE); |
1784 | 1671 |
1785 gtk_box_pack_end(GTK_BOX(render_area_vbox_), | 1672 gtk_box_pack_end(GTK_BOX(render_area_vbox_), |
1786 contents_vsplit_, TRUE, TRUE, 0); | 1673 contents_vsplit_, TRUE, TRUE, 0); |
1787 | 1674 |
1788 gtk_widget_show_all(render_area_floating_container_); | 1675 gtk_widget_show_all(render_area_floating_container_); |
1789 render_area_event_box_ = gtk_event_box_new(); | 1676 render_area_event_box_ = gtk_event_box_new(); |
1790 // Set a white background so during startup the user sees white in the | 1677 // Set a white background so during startup the user sees white in the |
1791 // content area before we get a WebContents in place. | 1678 // content area before we get a WebContents in place. |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2407 bool BrowserWindowGtk::DrawFrameAsActive() const { | 2294 bool BrowserWindowGtk::DrawFrameAsActive() const { |
2408 if (ui::ActiveWindowWatcherX::WMSupportsActivation()) | 2295 if (ui::ActiveWindowWatcherX::WMSupportsActivation()) |
2409 return is_active_; | 2296 return is_active_; |
2410 | 2297 |
2411 // Since we don't get notifications when the active state of the frame | 2298 // Since we don't get notifications when the active state of the frame |
2412 // changes, we can't consistently repaint the frame at the right time. Instead | 2299 // changes, we can't consistently repaint the frame at the right time. Instead |
2413 // we always draw the frame as active. | 2300 // we always draw the frame as active. |
2414 return true; | 2301 return true; |
2415 } | 2302 } |
2416 | 2303 |
2304 void BrowserWindowGtk::UpdateDevToolsForContents(WebContents* contents) { | |
2305 TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::UpdateDevToolsForContents"); | |
2306 DevToolsWindow* new_devtools_window = contents ? | |
2307 DevToolsWindow::GetDockedInstanceForInspectedTab(contents) : NULL; | |
2308 | |
2309 // Fast return in case of the same window having same orientation. | |
2310 if (devtools_window_ == new_devtools_window) { | |
2311 if (!new_devtools_window || | |
Evan Stade
2012/10/26 03:56:47
why nested ifs instead of one big if?
pfeldman
2012/10/26 03:59:52
It is already hard to parse that logic, I thought
pfeldman
2012/10/26 08:51:29
Done.
| |
2312 (new_devtools_window->dock_side() == devtools_dock_side_)) { | |
2313 return; | |
2314 } | |
2315 } | |
2316 | |
2317 // Replace tab contents. | |
2318 if (devtools_window_ != new_devtools_window) { | |
2319 if (devtools_window_) | |
2320 devtools_container_->DetachTab(devtools_window_->tab_contents()); | |
2321 devtools_container_->SetTab( | |
2322 new_devtools_window ? new_devtools_window->tab_contents() : NULL); | |
2323 if (new_devtools_window) { | |
2324 // WebContentsViewGtk::WasShown is not called when tab contents is shown | |
2325 // by anything other than user selecting a Tab. | |
2326 // See TabContentsViewViews::OnWindowPosChanged for reference on how it | |
2327 // should be implemented. | |
2328 new_devtools_window->tab_contents()->web_contents()->WasShown(); | |
2329 } | |
2330 } | |
2331 | |
2332 // Store last used position. | |
2333 if (devtools_window_) { | |
2334 GtkAllocation contents_rect; | |
2335 gtk_widget_get_allocation(contents_vsplit_, &contents_rect); | |
2336 if (devtools_dock_side_ == DEVTOOLS_DOCK_SIDE_RIGHT) { | |
2337 devtools_window_->SetWidth( | |
2338 contents_rect.width - | |
2339 gtk_paned_get_position(GTK_PANED(contents_hsplit_))); | |
2340 } else { | |
2341 devtools_window_->SetHeight( | |
2342 contents_rect.height - | |
2343 gtk_paned_get_position(GTK_PANED(contents_vsplit_))); | |
2344 } | |
2345 } | |
2346 | |
2347 // Show / hide container if necessary. Changing dock orientation is | |
2348 // hide + show. | |
2349 bool should_hide = devtools_window_ && (!new_devtools_window || | |
2350 devtools_dock_side_ != new_devtools_window->dock_side()); | |
2351 bool should_show = new_devtools_window && (!devtools_window_ || should_hide); | |
2352 | |
2353 if (should_hide) | |
2354 HideDevToolsContainer(); | |
2355 | |
2356 devtools_window_ = new_devtools_window; | |
2357 | |
2358 if (should_show) { | |
2359 devtools_dock_side_ = new_devtools_window->dock_side(); | |
2360 ShowDevToolsContainer(); | |
2361 } else if (new_devtools_window) { | |
2362 UpdateDevToolsSplitPosition(); | |
2363 } | |
2364 } | |
2365 | |
2366 void BrowserWindowGtk::ShowDevToolsContainer() { | |
2367 if (devtools_dock_side_ == DEVTOOLS_DOCK_SIDE_RIGHT) { | |
Evan Stade
2012/10/26 03:56:47
I might turn this into a ternary operator
pfeldman
2012/10/26 03:59:52
I wanted this to match the other ports where it ta
pfeldman
2012/10/26 08:51:29
Done.
| |
2368 gtk_paned_pack2(GTK_PANED(contents_hsplit_), devtools_container_->widget(), | |
2369 FALSE, TRUE); | |
2370 } else { | |
2371 gtk_paned_pack2(GTK_PANED(contents_vsplit_), devtools_container_->widget(), | |
2372 FALSE, TRUE); | |
2373 } | |
2374 UpdateDevToolsSplitPosition(); | |
2375 gtk_widget_show(devtools_container_->widget()); | |
2376 } | |
2377 | |
2378 void BrowserWindowGtk::HideDevToolsContainer() { | |
2379 if (devtools_dock_side_ == DEVTOOLS_DOCK_SIDE_RIGHT) { | |
Evan Stade
2012/10/26 03:56:47
I might turn this into a ternary operator
pfeldman
2012/10/26 03:59:52
ditto
pfeldman
2012/10/26 08:51:29
Done.
| |
2380 gtk_container_remove(GTK_CONTAINER(contents_hsplit_), | |
2381 devtools_container_->widget()); | |
2382 } else { | |
2383 gtk_container_remove(GTK_CONTAINER(contents_vsplit_), | |
2384 devtools_container_->widget()); | |
2385 } | |
2386 } | |
2387 | |
2388 void BrowserWindowGtk::UpdateDevToolsSplitPosition() { | |
2389 GtkAllocation contents_rect; | |
2390 gtk_widget_get_allocation(contents_vsplit_, &contents_rect); | |
2391 | |
2392 if (devtools_window_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT) { | |
2393 int split_offset = contents_rect.width - | |
2394 devtools_window_->GetWidth(contents_rect.width); | |
2395 gtk_paned_set_position(GTK_PANED(contents_hsplit_), split_offset); | |
2396 } else { | |
2397 int split_offset = contents_rect.height - | |
2398 devtools_window_->GetHeight(contents_rect.height); | |
2399 gtk_paned_set_position(GTK_PANED(contents_vsplit_), split_offset); | |
2400 } | |
2401 } | |
2402 | |
2417 // static | 2403 // static |
2418 bool BrowserWindowGtk::GetCustomFramePrefDefault() { | 2404 bool BrowserWindowGtk::GetCustomFramePrefDefault() { |
2419 // Ideally, we'd use the custom frame by default and just fall back on using | 2405 // Ideally, we'd use the custom frame by default and just fall back on using |
2420 // system decorations for the few (?) tiling window managers where the custom | 2406 // system decorations for the few (?) tiling window managers where the custom |
2421 // frame doesn't make sense (e.g. awesome, ion3, ratpoison, xmonad, etc.) or | 2407 // frame doesn't make sense (e.g. awesome, ion3, ratpoison, xmonad, etc.) or |
2422 // other WMs where it has issues (e.g. Fluxbox -- see issue 19130). The EWMH | 2408 // other WMs where it has issues (e.g. Fluxbox -- see issue 19130). The EWMH |
2423 // _NET_SUPPORTING_WM property makes it easy to look up a name for the current | 2409 // _NET_SUPPORTING_WM property makes it easy to look up a name for the current |
2424 // WM, but at least some of the WMs in the latter group don't set it. | 2410 // WM, but at least some of the WMs in the latter group don't set it. |
2425 // Instead, we default to using system decorations for all WMs and | 2411 // Instead, we default to using system decorations for all WMs and |
2426 // special-case the ones where the custom frame should be used. | 2412 // special-case the ones where the custom frame should be used. |
2427 ui::WindowManagerName wm_type = ui::GuessWindowManager(); | 2413 ui::WindowManagerName wm_type = ui::GuessWindowManager(); |
2428 return (wm_type == ui::WM_BLACKBOX || | 2414 return (wm_type == ui::WM_BLACKBOX || |
2429 wm_type == ui::WM_COMPIZ || | 2415 wm_type == ui::WM_COMPIZ || |
2430 wm_type == ui::WM_ENLIGHTENMENT || | 2416 wm_type == ui::WM_ENLIGHTENMENT || |
2431 wm_type == ui::WM_METACITY || | 2417 wm_type == ui::WM_METACITY || |
2432 wm_type == ui::WM_MUTTER || | 2418 wm_type == ui::WM_MUTTER || |
2433 wm_type == ui::WM_OPENBOX || | 2419 wm_type == ui::WM_OPENBOX || |
2434 wm_type == ui::WM_XFWM4); | 2420 wm_type == ui::WM_XFWM4); |
2435 } | 2421 } |
2436 | 2422 |
2437 // static | 2423 // static |
2438 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2424 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2439 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2425 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2440 browser_window_gtk->Init(); | 2426 browser_window_gtk->Init(); |
2441 return browser_window_gtk; | 2427 return browser_window_gtk; |
2442 } | 2428 } |
OLD | NEW |