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

Side by Side Diff: apps/app_window.cc

Issue 314113010: Remove deprecated permissions functions from Extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | apps/saved_files_service.cc » ('j') | no next file with comments »
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 "apps/app_window.h" 5 #include "apps/app_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "apps/app_window_geometry_cache.h" 9 #include "apps/app_window_geometry_cache.h"
10 #include "apps/app_window_registry.h" 10 #include "apps/app_window_registry.h"
(...skipping 23 matching lines...) Expand all
34 #include "content/public/common/content_switches.h" 34 #include "content/public/common/content_switches.h"
35 #include "content/public/common/media_stream_request.h" 35 #include "content/public/common/media_stream_request.h"
36 #include "extensions/browser/extension_registry.h" 36 #include "extensions/browser/extension_registry.h"
37 #include "extensions/browser/extension_system.h" 37 #include "extensions/browser/extension_system.h"
38 #include "extensions/browser/extensions_browser_client.h" 38 #include "extensions/browser/extensions_browser_client.h"
39 #include "extensions/browser/process_manager.h" 39 #include "extensions/browser/process_manager.h"
40 #include "extensions/browser/view_type_utils.h" 40 #include "extensions/browser/view_type_utils.h"
41 #include "extensions/common/extension.h" 41 #include "extensions/common/extension.h"
42 #include "extensions/common/extension_messages.h" 42 #include "extensions/common/extension_messages.h"
43 #include "extensions/common/manifest_handlers/icons_handler.h" 43 #include "extensions/common/manifest_handlers/icons_handler.h"
44 #include "extensions/common/permissions/permissions_data.h"
44 #include "grit/theme_resources.h" 45 #include "grit/theme_resources.h"
45 #include "third_party/skia/include/core/SkRegion.h" 46 #include "third_party/skia/include/core/SkRegion.h"
46 #include "ui/base/resource/resource_bundle.h" 47 #include "ui/base/resource/resource_bundle.h"
47 #include "ui/gfx/screen.h" 48 #include "ui/gfx/screen.h"
48 49
49 #if !defined(OS_MACOSX) 50 #if !defined(OS_MACOSX)
50 #include "apps/pref_names.h" 51 #include "apps/pref_names.h"
51 #include "base/prefs/pref_service.h" 52 #include "base/prefs/pref_service.h"
52 #endif 53 #endif
53 54
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 // fullscreen and it is not forced, we want to allow the user to leave 426 // fullscreen and it is not forced, we want to allow the user to leave
426 // when ESC is pressed. 427 // when ESC is pressed.
427 // However, if the application has the "overrideEscFullscreen" permission, we 428 // However, if the application has the "overrideEscFullscreen" permission, we
428 // should let it override that behavior. 429 // should let it override that behavior.
429 // ::HandleKeyboardEvent() will only be called if the KeyEvent's default 430 // ::HandleKeyboardEvent() will only be called if the KeyEvent's default
430 // action is not prevented. 431 // action is not prevented.
431 // Thus, we should handle the KeyEvent here only if the permission is not set. 432 // Thus, we should handle the KeyEvent here only if the permission is not set.
432 if (event.windowsKeyCode == ui::VKEY_ESCAPE && 433 if (event.windowsKeyCode == ui::VKEY_ESCAPE &&
433 (fullscreen_types_ != FULLSCREEN_TYPE_NONE) && 434 (fullscreen_types_ != FULLSCREEN_TYPE_NONE) &&
434 ((fullscreen_types_ & FULLSCREEN_TYPE_FORCED) == 0) && 435 ((fullscreen_types_ & FULLSCREEN_TYPE_FORCED) == 0) &&
435 !extension->HasAPIPermission(APIPermission::kOverrideEscFullscreen)) { 436 !extension->permissions_data()->HasAPIPermission(
437 APIPermission::kOverrideEscFullscreen)) {
436 Restore(); 438 Restore();
437 return true; 439 return true;
438 } 440 }
439 441
440 return false; 442 return false;
441 } 443 }
442 444
443 void AppWindow::HandleKeyboardEvent( 445 void AppWindow::HandleKeyboardEvent(
444 WebContents* source, 446 WebContents* source,
445 const content::NativeWebKeyboardEvent& event) { 447 const content::NativeWebKeyboardEvent& event) {
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 region.bounds.x(), 1140 region.bounds.x(),
1139 region.bounds.y(), 1141 region.bounds.y(),
1140 region.bounds.right(), 1142 region.bounds.right(),
1141 region.bounds.bottom(), 1143 region.bounds.bottom(),
1142 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 1144 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
1143 } 1145 }
1144 return sk_region; 1146 return sk_region;
1145 } 1147 }
1146 1148
1147 } // namespace apps 1149 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | apps/saved_files_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698