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

Unified Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 10534079: Add support for managing active state of platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed redundant GetNativeWindow() decl in BrowserWindow Created 8 years, 6 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
« no previous file with comments | « chrome/browser/ui/extensions/shell_window.h ('k') | chrome/browser/ui/gtk/extensions/shell_window_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/extensions/shell_window.cc
diff --git a/chrome/browser/ui/extensions/shell_window.cc b/chrome/browser/ui/extensions/shell_window.cc
index 69cf956cab94d1b3702952ba45f29e873daa203a..b57ab3e9fa3aa50f6ed25e2f95c0138ed1bd8425 100644
--- a/chrome/browser/ui/extensions/shell_window.cc
+++ b/chrome/browser/ui/extensions/shell_window.cc
@@ -49,7 +49,10 @@ ShellWindow* ShellWindow::Create(Profile* profile,
const GURL& url,
const ShellWindow::CreateParams params) {
// This object will delete itself when the window is closed.
- return ShellWindow::CreateImpl(profile, extension, url, params);
+ ShellWindow* window =
+ ShellWindow::CreateImpl(profile, extension, url, params);
+ ShellWindowRegistry::Get(profile)->AddShellWindow(window);
+ return window;
}
ShellWindow::ShellWindow(Profile* profile,
@@ -88,8 +91,6 @@ ShellWindow::ShellWindow(Profile* profile,
// Prevent the browser process from shutting down while this window is open.
browser::StartKeepAlive();
-
- ShellWindowRegistry::Get(profile_)->AddShellWindow(this);
}
ShellWindow::~ShellWindow() {
@@ -97,8 +98,6 @@ ShellWindow::~ShellWindow() {
// last window open.
registrar_.RemoveAll();
- ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this);
-
// Remove shutdown prevention.
browser::EndKeepAlive();
}
@@ -107,11 +106,17 @@ bool ShellWindow::IsFullscreenOrPending() const {
return false;
}
+void ShellWindow::OnNativeClose() {
Mihai Parparita -not on Chrome 2012/06/13 20:10:13 Not sure I understand the rationale behind adding
DaveMoore 2012/06/13 20:20:28 The reason is that if you call RemoveShellWindow f
+ ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this);
+ delete this;
+}
+
string16 ShellWindow::GetTitle() const {
// WebContents::GetTitle() will return the page's URL if there's no <title>
// specified. However, we'd prefer to show the name of the extension in that
// case, so we directly inspect the NavigationEntry's title.
- if (web_contents()->GetController().GetActiveEntry()->GetTitle().empty())
+ if (!web_contents()->GetController().GetActiveEntry() ||
+ web_contents()->GetController().GetActiveEntry()->GetTitle().empty())
return UTF8ToUTF16(extension()->name());
return web_contents()->GetTitle();
}
« no previous file with comments | « chrome/browser/ui/extensions/shell_window.h ('k') | chrome/browser/ui/gtk/extensions/shell_window_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698