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

Unified Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc

Issue 213743017: Remove title and icon from chrome apps native style title bars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nicer Created 6 years, 9 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/views/apps/chrome_native_app_window_views_win.cc
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
index 44bc4d820257209a5893abd5766b2dc5b43065dc..b045272d5fe5952fc7fea6316f60f03de573668f 100644
--- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
+++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
@@ -6,6 +6,7 @@
#include "apps/app_window.h"
#include "apps/app_window_registry.h"
+#include "apps/ui/views/app_window_frame_view.h"
#include "ash/shell.h"
#include "base/command_line.h"
#include "base/file_util.h"
@@ -18,6 +19,8 @@
#include "chrome/browser/metro_utils/metro_chrome_win.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/shell_integration.h"
+#include "chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.h"
+#include "chrome/browser/ui/views/apps/glass_app_window_frame_view.h"
#include "chrome/browser/ui/web_applications/web_app_ui.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_win.h"
@@ -31,6 +34,11 @@
#include "ui/base/win/shell.h"
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
#include "ui/views/win/hwnd_util.h"
+#include "ui/wm/core/easy_resize_window_targeter.h"
+
+#if defined(USE_ASH)
+#include "chrome/browser/ui/ash/ash_util.h"
+#endif
namespace {
@@ -69,7 +77,7 @@ void CreateIconAndSetRelaunchDetails(
} // namespace
ChromeNativeAppWindowViewsWin::ChromeNativeAppWindowViewsWin()
- : weak_ptr_factory_(this) {}
+ : weak_ptr_factory_(this), glass_frame_view_(NULL) {}
void ChromeNativeAppWindowViewsWin::ActivateParentDesktopIfNecessary() {
if (!ash::Shell::HasInstance())
@@ -141,7 +149,7 @@ void ChromeNativeAppWindowViewsWin::OnBeforeWidgetInit(
if (desktop_type == chrome::HOST_DESKTOP_TYPE_ASH)
init_params->context = ash::Shell::GetPrimaryRootWindow();
else
- init_params->native_widget = new views::DesktopNativeWidgetAura(widget);
+ init_params->native_widget = new AppWindowDesktopNativeWidgetAuraWin(this);
}
void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow(
@@ -169,6 +177,33 @@ void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow(
UpdateShelfMenu();
}
+views::NonClientFrameView*
+ChromeNativeAppWindowViewsWin::CreateStandardAppWindowFrame() {
+ glass_frame_view_ = NULL;
+ if (ui::win::IsAeroGlassEnabled()) {
tapted 2014/04/03 19:40:24 Does this need an IsNativeWindowInAsh check as wel
benwells 2014/04/04 06:50:43 This doesn't get called in that case. See ChromeNa
+ glass_frame_view_ = new apps::GlassAppWindowFrameView(this, widget());
+ return glass_frame_view_;
+ }
+ return ChromeNativeAppWindowViews::CreateStandardAppWindowFrame();
+}
+
+apps::AppWindowFrameView*
+ChromeNativeAppWindowViewsWin::CreateNonStandardAppWindowFrame() {
+ apps::AppWindowFrameView* frame =
+ ChromeNativeAppWindowViews::CreateNonStandardAppWindowFrame();
+
+ if (!chrome::IsNativeWindowInAsh(widget()->GetNativeWindow())) {
+ aura::Window* root_window = widget()->GetNativeWindow()->GetRootWindow();
+ int resize_inside = frame->resize_inside_bounds_size();
+ gfx::Insets inset(
+ resize_inside, resize_inside, resize_inside, resize_inside);
+ root_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>(
+ new wm::EasyResizeWindowTargeter(root_window, inset, inset)));
+ }
+
+ return frame;
+}
+
void ChromeNativeAppWindowViewsWin::Show() {
ActivateParentDesktopIfNecessary();
ChromeNativeAppWindowViews::Show();

Powered by Google App Engine
This is Rietveld 408576698