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

Unified Diff: chrome/browser/ui/panels/panel_manager.cc

Issue 8503037: Fix the problem that notifications and panels overlap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel_manager.cc
diff --git a/chrome/browser/ui/panels/panel_manager.cc b/chrome/browser/ui/panels/panel_manager.cc
index ff8df0e0e6d261818a2c01aec24eec7646c2f9ac..8e4847996ee9facbc43a69164f712a9c7d3a85eb 100644
--- a/chrome/browser/ui/panels/panel_manager.cc
+++ b/chrome/browser/ui/panels/panel_manager.cc
@@ -12,6 +12,9 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/window_sizer.h"
+#include "chrome/common/chrome_notification_types.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_source.h"
namespace {
// Invalid panel index.
@@ -127,6 +130,12 @@ Panel* PanelManager::CreatePanel(Browser* browser) {
Panel* panel = new Panel(browser, gfx::Rect(x, y, width, height));
panel->SetMaxSize(gfx::Size(max_panel_width, max_panel_height));
panels_.push_back(panel);
+
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_PANEL_ADDED,
+ content::Source<Panel>(panel),
+ content::NotificationService::NoDetails());
+
return panel;
}
@@ -173,6 +182,11 @@ void PanelManager::DoRemove(Panel* panel) {
gfx::Rect bounds = (*iter)->GetBounds();
Rearrange(panels_.erase(iter), bounds.right());
+
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_PANEL_REMOVED,
+ content::Source<Panel>(panel),
+ content::NotificationService::NoDetails());
}
void PanelManager::StartDragging(Panel* panel) {

Powered by Google App Engine
This is Rietveld 408576698