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

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

Issue 1316013004: Remove "API proposal for chrome.app.window to intercept all keys." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to TOT Created 5 years, 3 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 "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/app_mode/app_mode_utils.h" 9 #include "chrome/browser/app_mode/app_mode_utils.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/views/apps/desktop_keyboard_capture.h"
12 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views .h" 11 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views .h"
13 #include "chrome/browser/ui/views/frame/taskbar_decorator.h" 12 #include "chrome/browser/ui/views/frame/taskbar_decorator.h"
14 #include "components/favicon/content/content_favicon_driver.h" 13 #include "components/favicon/content/content_favicon_driver.h"
15 #include "components/ui/zoom/page_zoom.h" 14 #include "components/ui/zoom/page_zoom.h"
16 #include "components/ui/zoom/zoom_controller.h" 15 #include "components/ui/zoom/zoom_controller.h"
17 #include "ui/views/controls/webview/webview.h" 16 #include "ui/views/controls/webview/webview.h"
18 #include "ui/views/widget/widget.h" 17 #include "ui/views/widget/widget.h"
19 18
20 using extensions::AppWindow; 19 using extensions::AppWindow;
21 20
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 349 }
351 350
352 SkColor ChromeNativeAppWindowViews::ActiveFrameColor() const { 351 SkColor ChromeNativeAppWindowViews::ActiveFrameColor() const {
353 return active_frame_color_; 352 return active_frame_color_;
354 } 353 }
355 354
356 SkColor ChromeNativeAppWindowViews::InactiveFrameColor() const { 355 SkColor ChromeNativeAppWindowViews::InactiveFrameColor() const {
357 return inactive_frame_color_; 356 return inactive_frame_color_;
358 } 357 }
359 358
360 void ChromeNativeAppWindowViews::SetInterceptAllKeys(bool want_all_keys) {
361 if (want_all_keys && (desktop_keyboard_capture_.get() == NULL)) {
362 desktop_keyboard_capture_.reset(new DesktopKeyboardCapture(widget()));
363 } else if (!want_all_keys) {
364 desktop_keyboard_capture_.reset(NULL);
365 }
366 }
367
368 // NativeAppWindowViews implementation. 359 // NativeAppWindowViews implementation.
369 360
370 void ChromeNativeAppWindowViews::InitializeWindow( 361 void ChromeNativeAppWindowViews::InitializeWindow(
371 AppWindow* app_window, 362 AppWindow* app_window,
372 const AppWindow::CreateParams& create_params) { 363 const AppWindow::CreateParams& create_params) {
373 DCHECK(widget()); 364 DCHECK(widget());
374 has_frame_color_ = create_params.has_frame_color; 365 has_frame_color_ = create_params.has_frame_color;
375 active_frame_color_ = create_params.active_frame_color; 366 active_frame_color_ = create_params.active_frame_color;
376 inactive_frame_color_ = create_params.inactive_frame_color; 367 inactive_frame_color_ = create_params.inactive_frame_color;
377 if (create_params.window_type == AppWindow::WINDOW_TYPE_PANEL || 368 if (create_params.window_type == AppWindow::WINDOW_TYPE_PANEL ||
378 create_params.window_type == AppWindow::WINDOW_TYPE_V1_PANEL) { 369 create_params.window_type == AppWindow::WINDOW_TYPE_V1_PANEL) {
379 InitializePanelWindow(create_params); 370 InitializePanelWindow(create_params);
380 } else { 371 } else {
381 InitializeDefaultWindow(create_params); 372 InitializeDefaultWindow(create_params);
382 } 373 }
383 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( 374 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews(
384 Profile::FromBrowserContext(app_window->browser_context()), 375 Profile::FromBrowserContext(app_window->browser_context()),
385 widget()->GetFocusManager(), 376 widget()->GetFocusManager(),
386 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, 377 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY,
387 NULL)); 378 NULL));
388 } 379 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/apps/chrome_native_app_window_views.h ('k') | chrome/browser/ui/views/apps/desktop_keyboard_capture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698