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

Side by Side Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views.cc

Issue 290553002: Refactor menu dependency on aura/wm SetShadowType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_host.cc » ('j') | ui/views/widget/widget.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/views/apps/chrome_native_app_window_views.h" 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h"
6 6
7 #include "apps/ui/views/app_window_frame_view.h" 7 #include "apps/ui/views/app_window_frame_view.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/app_mode/app_mode_utils.h" 10 #include "chrome/browser/app_mode/app_mode_utils.h"
11 #include "chrome/browser/chrome_page_zoom.h" 11 #include "chrome/browser/chrome_page_zoom.h"
12 #include "chrome/browser/favicon/favicon_tab_helper.h" 12 #include "chrome/browser/favicon/favicon_tab_helper.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/host_desktop.h" 14 #include "chrome/browser/ui/host_desktop.h"
15 #include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h" 15 #include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h"
16 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views .h" 16 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views .h"
17 #include "chrome/browser/ui/views/frame/taskbar_decorator.h" 17 #include "chrome/browser/ui/views/frame/taskbar_decorator.h"
18 #include "chrome/browser/web_applications/web_app.h" 18 #include "chrome/browser/web_applications/web_app.h"
19 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
20 #include "extensions/common/extension.h" 20 #include "extensions/common/extension.h"
21 #include "ui/aura/window.h" 21 #include "ui/aura/window.h"
22 #include "ui/base/hit_test.h" 22 #include "ui/base/hit_test.h"
23 #include "ui/base/models/simple_menu_model.h" 23 #include "ui/base/models/simple_menu_model.h"
24 #include "ui/gfx/image/image_skia.h" 24 #include "ui/gfx/image/image_skia.h"
25 #include "ui/views/controls/menu/menu_runner.h" 25 #include "ui/views/controls/menu/menu_runner.h"
26 #include "ui/views/controls/webview/webview.h" 26 #include "ui/views/controls/webview/webview.h"
27 #include "ui/views/widget/widget.h" 27 #include "ui/views/widget/widget.h"
28 #include "ui/wm/core/easy_resize_window_targeter.h" 28 #include "ui/wm/core/easy_resize_window_targeter.h"
29 #include "ui/wm/core/shadow_types.h"
30 29
31 #if defined(OS_LINUX) 30 #if defined(OS_LINUX)
32 #include "chrome/browser/shell_integration_linux.h" 31 #include "chrome/browser/shell_integration_linux.h"
33 #endif 32 #endif
34 33
35 #if defined(USE_ASH) 34 #if defined(USE_ASH)
36 #include "ash/ash_constants.h" 35 #include "ash/ash_constants.h"
37 #include "ash/ash_switches.h" 36 #include "ash/ash_switches.h"
38 #include "ash/frame/custom_frame_view_ash.h" 37 #include "ash/frame/custom_frame_view_ash.h"
39 #include "ash/screen_util.h" 38 #include "ash/screen_util.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 248 }
250 249
251 if (IsFrameless() && 250 if (IsFrameless() &&
252 init_params.opacity == views::Widget::InitParams::TRANSLUCENT_WINDOW && 251 init_params.opacity == views::Widget::InitParams::TRANSLUCENT_WINDOW &&
253 !create_params.resizable) { 252 !create_params.resizable) {
254 // The given window is most likely not rectangular since it uses 253 // The given window is most likely not rectangular since it uses
255 // transparency, has no standard frame and the user cannot resize it using 254 // transparency, has no standard frame and the user cannot resize it using
256 // the OS supplied methods. Therefore we do not use a shadow for it. 255 // the OS supplied methods. Therefore we do not use a shadow for it.
257 // TODO(skuhne): If we run into an application which should have a shadow 256 // TODO(skuhne): If we run into an application which should have a shadow
258 // but does not have, a new attribute has to be added. 257 // but does not have, a new attribute has to be added.
259 wm::SetShadowType(widget()->GetNativeWindow(), wm::SHADOW_TYPE_NONE); 258 widget()->SetHasActivationShadow(false);
260 } 259 }
261 260
262 // Register accelarators supported by app windows. 261 // Register accelarators supported by app windows.
263 // TODO(jeremya/stevenjb): should these be registered for panels too? 262 // TODO(jeremya/stevenjb): should these be registered for panels too?
264 views::FocusManager* focus_manager = GetFocusManager(); 263 views::FocusManager* focus_manager = GetFocusManager();
265 const std::map<ui::Accelerator, int>& accelerator_table = 264 const std::map<ui::Accelerator, int>& accelerator_table =
266 GetAcceleratorTable(); 265 GetAcceleratorTable();
267 const bool is_kiosk_app_mode = chrome::IsRunningInForcedAppMode(); 266 const bool is_kiosk_app_mode = chrome::IsRunningInForcedAppMode();
268 267
269 // Ensures that kiosk mode accelerators are enabled when in kiosk mode (to be 268 // Ensures that kiosk mode accelerators are enabled when in kiosk mode (to be
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 InitializePanelWindow(create_params); 717 InitializePanelWindow(create_params);
719 } else { 718 } else {
720 InitializeDefaultWindow(create_params); 719 InitializeDefaultWindow(create_params);
721 } 720 }
722 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( 721 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews(
723 Profile::FromBrowserContext(app_window->browser_context()), 722 Profile::FromBrowserContext(app_window->browser_context()),
724 widget()->GetFocusManager(), 723 widget()->GetFocusManager(),
725 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, 724 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY,
726 NULL)); 725 NULL));
727 } 726 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_host.cc » ('j') | ui/views/widget/widget.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698