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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 7850026: Aura under Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Still a few linking errors to resolve. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 event.modifiers == NativeWebKeyboardEvent::AltKey) { 1224 event.modifiers == NativeWebKeyboardEvent::AltKey) {
1225 DefWindowProc(event.os_event.hwnd, event.os_event.message, 1225 DefWindowProc(event.os_event.hwnd, event.os_event.message,
1226 event.os_event.wParam, event.os_event.lParam); 1226 event.os_event.wParam, event.os_event.lParam);
1227 return true; 1227 return true;
1228 } 1228 }
1229 #endif 1229 #endif
1230 1230
1231 views::FocusManager* focus_manager = GetFocusManager(); 1231 views::FocusManager* focus_manager = GetFocusManager();
1232 DCHECK(focus_manager); 1232 DCHECK(focus_manager);
1233 1233
1234 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) 1234 #if defined(TOOLKIT_USES_GTK) && !(defined(TOUCH_UI) || defined(USE_AURA))
1235 // Views and WebKit use different tables for GdkEventKey -> views::KeyEvent 1235 // Views and WebKit use different tables for GdkEventKey -> views::KeyEvent
1236 // conversion. We need to use View's conversion table here to keep consistent 1236 // conversion. We need to use View's conversion table here to keep consistent
1237 // behavior with views::FocusManager::OnKeyEvent() method. 1237 // behavior with views::FocusManager::OnKeyEvent() method.
1238 // TODO(suzhe): We need to check if Windows code also has this issue, and 1238 // TODO(suzhe): We need to check if Windows code also has this issue, and
1239 // it'll be best if we can unify these conversion tables. 1239 // it'll be best if we can unify these conversion tables.
1240 // See http://crbug.com/54315 1240 // See http://crbug.com/54315
1241 views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event)); 1241 views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event));
1242 views::Accelerator accelerator(views_event.key_code(), 1242 views::Accelerator accelerator(views_event.key_code(),
1243 views_event.IsShiftDown(), 1243 views_event.IsShiftDown(),
1244 views_event.IsControlDown(), 1244 views_event.IsControlDown(),
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 } 1289 }
1290 1290
1291 DCHECK(is_keyboard_shortcut != NULL); 1291 DCHECK(is_keyboard_shortcut != NULL);
1292 *is_keyboard_shortcut = true; 1292 *is_keyboard_shortcut = true;
1293 1293
1294 return false; 1294 return false;
1295 } 1295 }
1296 1296
1297 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { 1297 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
1298 // TODO(ben): figure out why are these two code paths so different 1298 // TODO(ben): figure out why are these two code paths so different
1299 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) 1299 #if defined(TOOLKIT_USES_GTK) && !(defined(TOUCH_UI) || defined(USE_AURA))
1300 HandleWebKeyboardEvent(GetWidget(), event); 1300 HandleWebKeyboardEvent(GetWidget(), event);
1301 #else 1301 #else
1302 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, 1302 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event,
1303 GetFocusManager()); 1303 GetFocusManager());
1304 #endif 1304 #endif
1305 } 1305 }
1306 1306
1307 void BrowserView::ToggleUseCompactNavigationBar() { 1307 void BrowserView::ToggleUseCompactNavigationBar() {
1308 bool use_compact_navigation_bar = UseCompactNavigationBar(); 1308 bool use_compact_navigation_bar = UseCompactNavigationBar();
1309 // Compact Navigation Bar only works with horizontal tabs for now! 1309 // Compact Navigation Bar only works with horizontal tabs for now!
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { 2692 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
2693 // Create the view and the frame. The frame will attach itself via the view 2693 // Create the view and the frame. The frame will attach itself via the view
2694 // so we don't need to do anything with the pointer. 2694 // so we don't need to do anything with the pointer.
2695 BrowserView* view = new BrowserView(browser); 2695 BrowserView* view = new BrowserView(browser);
2696 (new BrowserFrame(view))->InitBrowserFrame(); 2696 (new BrowserFrame(view))->InitBrowserFrame();
2697 view->GetWidget()->non_client_view()->SetAccessibleName( 2697 view->GetWidget()->non_client_view()->SetAccessibleName(
2698 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 2698 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
2699 return view; 2699 return view;
2700 } 2700 }
2701 #endif 2701 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698