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

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

Issue 10831226: Panels refactor: Support browserless panels on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel.cc
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc
index a2e1eb0d016b966f6fa78dae72c1ec36256d7a06..aed6ed101cd6f3497003d7b9474628db626ff90c 100644
--- a/chrome/browser/ui/panels/panel.cc
+++ b/chrome/browser/ui/panels/panel.cc
@@ -102,6 +102,7 @@ bool PanelExtensionWindowController::IsVisibleToExtension(
Panel::Panel(const std::string& app_name,
const gfx::Size& min_size, const gfx::Size& max_size)
: app_name_(app_name),
+ profile_(NULL),
panel_strip_(NULL),
initialized_(false),
min_size_(min_size),
@@ -142,6 +143,7 @@ void Panel::Initialize(Profile* profile, const GURL& url,
DCHECK_EQ(EXPANDED, expansion_state_);
DCHECK(!bounds.IsEmpty());
initialized_ = true;
+ profile_ = profile;
full_size_ = bounds.size();
native_panel_ = CreateNativePanel(this, bounds);
@@ -215,7 +217,7 @@ CommandUpdater* Panel::command_updater() {
}
Profile* Panel::profile() const {
- return extension_window_controller_->profile();
+ return profile_;
}
const std::string Panel::extension_id() const {
@@ -552,6 +554,16 @@ void Panel::ExecuteCommandWithDisposition(int id,
panel_host_->StopLoading();
break;
+ // Window management.
+ case IDC_CLOSE_WINDOW:
+ content::RecordAction(UserMetricsAction("CloseWindow"));
+ Close();
+ break;
+ case IDC_EXIT:
+ content::RecordAction(UserMetricsAction("Exit"));
+ browser::AttemptUserExit();
+ break;
+
// Clipboard
case IDC_COPY:
content::RecordAction(UserMetricsAction("Copy"));

Powered by Google App Engine
This is Rietveld 408576698