Chromium Code Reviews| 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 <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1046 | 1046 |
| 1047 void BrowserWindowGtk::ShowAboutChromeDialog() { | 1047 void BrowserWindowGtk::ShowAboutChromeDialog() { |
| 1048 ShowAboutDialogForProfile(window_, browser_->profile(), browser_.get()); | 1048 ShowAboutDialogForProfile(window_, browser_->profile(), browser_.get()); |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 void BrowserWindowGtk::ShowUpdateChromeDialog() { | 1051 void BrowserWindowGtk::ShowUpdateChromeDialog() { |
| 1052 UpdateRecommendedDialog::Show(window_); | 1052 UpdateRecommendedDialog::Show(window_); |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 void BrowserWindowGtk::ShowTaskManager() { | 1055 void BrowserWindowGtk::ShowTaskManager() { |
| 1056 TaskManagerGtk::Show(false); | 1056 TaskManagerGtk::Show(false); |
|
kkania
2012/06/01 04:14:03
normally you don't sync a branch with a CL in revi
| |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 void BrowserWindowGtk::ShowBackgroundPages() { | 1059 void BrowserWindowGtk::ShowBackgroundPages() { |
| 1060 TaskManagerGtk::Show(true); | 1060 TaskManagerGtk::Show(true); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 void BrowserWindowGtk::ShowBookmarkBubble(const GURL& url, | 1063 void BrowserWindowGtk::ShowBookmarkBubble(const GURL& url, |
| 1064 bool already_bookmarked) { | 1064 bool already_bookmarked) { |
| 1065 toolbar_->GetLocationBarView()->ShowStarBubble(url, !already_bookmarked); | 1065 toolbar_->GetLocationBarView()->ShowStarBubble(url, !already_bookmarked); |
| 1066 } | 1066 } |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1596 } else { | 1596 } else { |
| 1597 fullscreen_exit_bubble_type_ = | 1597 fullscreen_exit_bubble_type_ = |
| 1598 FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION; | 1598 FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION; |
| 1599 gtk_widget_show(titlebar_widget()); | 1599 gtk_widget_show(titlebar_widget()); |
| 1600 fullscreen_exit_bubble_.reset(); | 1600 fullscreen_exit_bubble_.reset(); |
| 1601 UpdateCustomFrame(); | 1601 UpdateCustomFrame(); |
| 1602 ShowSupportedWindowFeatures(); | 1602 ShowSupportedWindowFeatures(); |
| 1603 } | 1603 } |
| 1604 } | 1604 } |
| 1605 | 1605 |
| 1606 if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) { | |
|
Ben Goodger (Google)
2012/06/01 17:10:11
is this already supported on other platforms?
can
zori
2012/06/02 01:20:54
Since other platforms execute the maximize operati
| |
| 1607 content::NotificationService::current()->Notify( | |
| 1608 chrome::NOTIFICATION_BROWSER_WINDOW_MAXIMIZED, | |
| 1609 content::Source<BrowserWindowGtk>(this), | |
|
kkania
2012/06/01 04:14:03
Just use BrowserWindow
zori
2012/06/02 01:20:54
Done.
| |
| 1610 content::NotificationService::NoDetails()); | |
| 1611 } | |
| 1612 | |
| 1606 titlebar_->UpdateCustomFrame(UseCustomFrame() && !IsFullscreen()); | 1613 titlebar_->UpdateCustomFrame(UseCustomFrame() && !IsFullscreen()); |
| 1607 UpdateWindowShape(bounds_.width(), bounds_.height()); | 1614 UpdateWindowShape(bounds_.width(), bounds_.height()); |
| 1608 SaveWindowPosition(); | 1615 SaveWindowPosition(); |
| 1609 return FALSE; | 1616 return FALSE; |
| 1610 } | 1617 } |
| 1611 | 1618 |
| 1612 // Callback for the delete event. This event is fired when the user tries to | 1619 // Callback for the delete event. This event is fired when the user tries to |
| 1613 // close the window (e.g., clicking on the X in the window manager title bar). | 1620 // close the window (e.g., clicking on the X in the window manager title bar). |
| 1614 gboolean BrowserWindowGtk::OnMainWindowDeleteEvent(GtkWidget* widget, | 1621 gboolean BrowserWindowGtk::OnMainWindowDeleteEvent(GtkWidget* widget, |
| 1615 GdkEvent* event) { | 1622 GdkEvent* event) { |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2589 wm_type == ui::WM_OPENBOX || | 2596 wm_type == ui::WM_OPENBOX || |
| 2590 wm_type == ui::WM_XFWM4); | 2597 wm_type == ui::WM_XFWM4); |
| 2591 } | 2598 } |
| 2592 | 2599 |
| 2593 // static | 2600 // static |
| 2594 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2601 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 2595 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2602 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
| 2596 browser_window_gtk->Init(); | 2603 browser_window_gtk->Init(); |
| 2597 return browser_window_gtk; | 2604 return browser_window_gtk; |
| 2598 } | 2605 } |
| OLD | NEW |