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

Side by Side Diff: chrome/browser/ui/panels/panel_manager.cc

Issue 1541033002: Add --disable-panels for blocking all extensions from using panels. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
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/panels/panel_manager.h" 5 #include "chrome/browser/ui/panels/panel_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 99
100 // static 100 // static
101 void PanelManager::SetDisplaySettingsProviderForTesting( 101 void PanelManager::SetDisplaySettingsProviderForTesting(
102 DisplaySettingsProvider* provider) { 102 DisplaySettingsProvider* provider) {
103 display_settings_provider_for_testing = provider; 103 display_settings_provider_for_testing = provider;
104 } 104 }
105 105
106 // static 106 // static
107 bool PanelManager::ShouldUsePanels(const std::string& extension_id) { 107 bool PanelManager::ShouldUsePanels(const std::string& extension_id) {
108 // If --disable-panels is on, never use panels.
109 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
110 switches::kDisablePanels))
111 return false;
112
108 // If --enable-panels is on, always use panels. 113 // If --enable-panels is on, always use panels.
109 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 114 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
110 switches::kEnablePanels)) 115 switches::kEnablePanels))
111 return true; 116 return true;
112 117
113 #if defined(USE_X11) && !defined(OS_CHROMEOS) 118 #if defined(USE_X11) && !defined(OS_CHROMEOS)
114 // On Linux, panels are only supported on tested window managers. 119 // On Linux, panels are only supported on tested window managers.
115 ui::WindowManagerName wm_type = ui::GuessWindowManager(); 120 ui::WindowManagerName wm_type = ui::GuessWindowManager();
116 if (wm_type != ui::WM_COMPIZ && 121 if (wm_type != ui::WM_COMPIZ &&
117 wm_type != ui::WM_ICE_WM && 122 wm_type != ui::WM_ICE_WM &&
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { 575 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) {
571 panel_mouse_watcher_.reset(watcher); 576 panel_mouse_watcher_.reset(watcher);
572 } 577 }
573 578
574 void PanelManager::OnPanelAnimationEnded(Panel* panel) { 579 void PanelManager::OnPanelAnimationEnded(Panel* panel) {
575 content::NotificationService::current()->Notify( 580 content::NotificationService::current()->Notify(
576 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, 581 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED,
577 content::Source<Panel>(panel), 582 content::Source<Panel>(panel),
578 content::NotificationService::NoDetails()); 583 content::NotificationService::NoDetails());
579 } 584 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698