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

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

Issue 297123002: API proposal for chrome.app.window to intercept all keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update based on sky's comments Created 6 years, 4 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
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"
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 } 677 }
678 678
679 SkColor ChromeNativeAppWindowViews::ActiveFrameColor() const { 679 SkColor ChromeNativeAppWindowViews::ActiveFrameColor() const {
680 return active_frame_color_; 680 return active_frame_color_;
681 } 681 }
682 682
683 SkColor ChromeNativeAppWindowViews::InactiveFrameColor() const { 683 SkColor ChromeNativeAppWindowViews::InactiveFrameColor() const {
684 return inactive_frame_color_; 684 return inactive_frame_color_;
685 } 685 }
686 686
687 void ChromeNativeAppWindowViews::SetInterceptAllKeys(bool want_all_keys) {
688 widget()->SetInterceptAllKeys(want_all_keys);
689 }
690
687 // NativeAppWindowViews implementation. 691 // NativeAppWindowViews implementation.
688 692
689 void ChromeNativeAppWindowViews::InitializeWindow( 693 void ChromeNativeAppWindowViews::InitializeWindow(
690 AppWindow* app_window, 694 AppWindow* app_window,
691 const AppWindow::CreateParams& create_params) { 695 const AppWindow::CreateParams& create_params) {
692 DCHECK(widget()); 696 DCHECK(widget());
693 has_frame_color_ = create_params.has_frame_color; 697 has_frame_color_ = create_params.has_frame_color;
694 active_frame_color_ = create_params.active_frame_color; 698 active_frame_color_ = create_params.active_frame_color;
695 inactive_frame_color_ = create_params.inactive_frame_color; 699 inactive_frame_color_ = create_params.inactive_frame_color;
696 if (create_params.window_type == AppWindow::WINDOW_TYPE_PANEL || 700 if (create_params.window_type == AppWindow::WINDOW_TYPE_PANEL ||
697 create_params.window_type == AppWindow::WINDOW_TYPE_V1_PANEL) { 701 create_params.window_type == AppWindow::WINDOW_TYPE_V1_PANEL) {
698 InitializePanelWindow(create_params); 702 InitializePanelWindow(create_params);
699 } else { 703 } else {
700 InitializeDefaultWindow(create_params); 704 InitializeDefaultWindow(create_params);
701 } 705 }
702 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( 706 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews(
703 Profile::FromBrowserContext(app_window->browser_context()), 707 Profile::FromBrowserContext(app_window->browser_context()),
704 widget()->GetFocusManager(), 708 widget()->GetFocusManager(),
705 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, 709 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY,
706 NULL)); 710 NULL));
707 } 711 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698