Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Side by Side Diff: chrome/browser/ui/gtk/browser_window_gtk.cc

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <dlfcn.h> 9 #include <dlfcn.h>
10 #include <string> 10 #include <string>
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 1154
1155 WindowOpenDisposition BrowserWindowGtk::GetDispositionForPopupBounds( 1155 WindowOpenDisposition BrowserWindowGtk::GetDispositionForPopupBounds(
1156 const gfx::Rect& bounds) { 1156 const gfx::Rect& bounds) {
1157 return NEW_POPUP; 1157 return NEW_POPUP;
1158 } 1158 }
1159 1159
1160 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { 1160 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() {
1161 new DownloadInProgressDialogGtk(browser()); 1161 new DownloadInProgressDialogGtk(browser());
1162 } 1162 }
1163 1163
1164 void BrowserWindowGtk::Observe(NotificationType type, 1164 void BrowserWindowGtk::Observe(int type,
1165 const NotificationSource& source, 1165 const NotificationSource& source,
1166 const NotificationDetails& details) { 1166 const NotificationDetails& details) {
1167 switch (type.value) { 1167 switch (type) {
1168 case NotificationType::PREF_CHANGED: { 1168 case chrome::PREF_CHANGED: {
1169 std::string* pref_name = Details<std::string>(details).ptr(); 1169 std::string* pref_name = Details<std::string>(details).ptr();
1170 if (*pref_name == prefs::kUseCustomChromeFrame) { 1170 if (*pref_name == prefs::kUseCustomChromeFrame) {
1171 UpdateCustomFrame(); 1171 UpdateCustomFrame();
1172 } else { 1172 } else {
1173 NOTREACHED() << "Got pref change notification we didn't register for!"; 1173 NOTREACHED() << "Got pref change notification we didn't register for!";
1174 } 1174 }
1175 break; 1175 break;
1176 } 1176 }
1177 1177
1178 default: 1178 default:
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 // Tab strip isn't empty. Hide the window (so it appears to have closed 1501 // Tab strip isn't empty. Hide the window (so it appears to have closed
1502 // immediately) and close all the tabs, allowing the renderers to shut 1502 // immediately) and close all the tabs, allowing the renderers to shut
1503 // down. When the tab strip is empty we'll be called back again. 1503 // down. When the tab strip is empty we'll be called back again.
1504 gtk_widget_hide(GTK_WIDGET(window_)); 1504 gtk_widget_hide(GTK_WIDGET(window_));
1505 browser_->OnWindowClosing(); 1505 browser_->OnWindowClosing();
1506 return false; 1506 return false;
1507 } 1507 }
1508 1508
1509 // Empty TabStripModel, it's now safe to allow the Window to be closed. 1509 // Empty TabStripModel, it's now safe to allow the Window to be closed.
1510 NotificationService::current()->Notify( 1510 NotificationService::current()->Notify(
1511 NotificationType::WINDOW_CLOSED, 1511 chrome::WINDOW_CLOSED,
1512 Source<GtkWindow>(window_), 1512 Source<GtkWindow>(window_),
1513 NotificationService::NoDetails()); 1513 NotificationService::NoDetails());
1514 return true; 1514 return true;
1515 } 1515 }
1516 1516
1517 bool BrowserWindowGtk::ShouldShowWindowIcon() const { 1517 bool BrowserWindowGtk::ShouldShowWindowIcon() const {
1518 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); 1518 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR);
1519 } 1519 }
1520 1520
1521 void BrowserWindowGtk::DisableDebounceTimerForTests(bool is_disabled) { 1521 void BrowserWindowGtk::DisableDebounceTimerForTests(bool is_disabled) {
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 // are taken from the WMs' source code. 2356 // are taken from the WMs' source code.
2357 return (wm_name == "Blackbox" || 2357 return (wm_name == "Blackbox" ||
2358 wm_name == "compiz" || 2358 wm_name == "compiz" ||
2359 wm_name == "Compiz" || 2359 wm_name == "Compiz" ||
2360 wm_name == "e16" || // Enlightenment DR16 2360 wm_name == "e16" || // Enlightenment DR16
2361 wm_name == "Metacity" || 2361 wm_name == "Metacity" ||
2362 wm_name == "Mutter" || 2362 wm_name == "Mutter" ||
2363 wm_name == "Openbox" || 2363 wm_name == "Openbox" ||
2364 wm_name == "Xfwm4"); 2364 wm_name == "Xfwm4");
2365 } 2365 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698