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

Unified Diff: chrome/browser/ui/views/extensions/native_app_window_views.cc

Issue 12212207: Support panel titles and Icons for v1 apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment. Created 7 years, 10 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/views/extensions/native_app_window_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/extensions/native_app_window_views.cc
diff --git a/chrome/browser/ui/views/extensions/native_app_window_views.cc b/chrome/browser/ui/views/extensions/native_app_window_views.cc
index fc227546971246b00d0440e2d1b8176f497fc77e..bf9dc1ff613a39b8edd74d56232ea618f40abd1b 100644
--- a/chrome/browser/ui/views/extensions/native_app_window_views.cc
+++ b/chrome/browser/ui/views/extensions/native_app_window_views.cc
@@ -57,11 +57,12 @@ NativeAppWindowViews::NativeAppWindowViews(
maximum_size_ = create_params.maximum_size;
window_ = new views::Widget;
- if (create_params.window_type == ShellWindow::WINDOW_TYPE_PANEL)
+ if (create_params.window_type == ShellWindow::WINDOW_TYPE_PANEL ||
+ create_params.window_type == ShellWindow::WINDOW_TYPE_V1_PANEL) {
InitializePanelWindow(create_params);
- else
+ } else {
InitializeDefaultWindow(create_params);
-
+ }
extension_keybinding_registry_.reset(
new ExtensionKeybindingRegistryViews(
profile(),
@@ -235,7 +236,7 @@ void NativeAppWindowViews::FlashFrame(bool flash) {
}
bool NativeAppWindowViews::IsAlwaysOnTop() const {
- return shell_window_->window_type() == ShellWindow::WINDOW_TYPE_PANEL;
+ return shell_window_->window_type_is_panel();
}
gfx::Insets NativeAppWindowViews::GetFrameInsets() const {
@@ -331,7 +332,7 @@ string16 NativeAppWindowViews::GetWindowTitle() const {
}
bool NativeAppWindowViews::ShouldShowWindowTitle() const {
- return false;
+ return shell_window_->window_type() == ShellWindow::WINDOW_TYPE_V1_PANEL;
}
gfx::ImageSkia NativeAppWindowViews::GetWindowAppIcon() {
@@ -354,6 +355,10 @@ gfx::ImageSkia NativeAppWindowViews::GetWindowIcon() {
return gfx::ImageSkia();
}
+bool NativeAppWindowViews::ShouldShowWindowIcon() const {
+ return shell_window_->window_type() == ShellWindow::WINDOW_TYPE_V1_PANEL;
+}
+
void NativeAppWindowViews::SaveWindowPlacement(const gfx::Rect& bounds,
ui::WindowShowState show_state) {
views::WidgetDelegate::SaveWindowPlacement(bounds, show_state);
@@ -377,7 +382,7 @@ views::NonClientFrameView* NativeAppWindowViews::CreateNonClientFrameView(
views::Widget* widget) {
#if defined(USE_ASH)
if (chrome::IsNativeViewInAsh(widget->GetNativeView())) {
- if (shell_window_->window_type() == ShellWindow::WINDOW_TYPE_PANEL) {
+ if (shell_window_->window_type_is_panel()) {
ash::PanelFrameView::FrameType frame_type = frameless_ ?
ash::PanelFrameView::FRAME_NONE : ash::PanelFrameView::FRAME_ASH;
return new ash::PanelFrameView(widget, frame_type);
@@ -477,7 +482,7 @@ void NativeAppWindowViews::OnFocus() {
void NativeAppWindowViews::SetFullscreen(bool fullscreen) {
// Fullscreen not supported by panels.
- if (shell_window_->window_type() == ShellWindow::WINDOW_TYPE_PANEL)
+ if (shell_window_->window_type_is_panel())
return;
is_fullscreen_ = fullscreen;
window_->SetFullscreen(fullscreen);
« no previous file with comments | « chrome/browser/ui/views/extensions/native_app_window_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698