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

Side by Side Diff: chrome/browser/ui/views/dropdown_bar_host_aura.cc

Issue 739993002: MacViews: Fix build errors related to NativeWebKeyboardEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix for Sadrul Created 6 years 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
« no previous file with comments | « chrome/browser/ui/views/dropdown_bar_host.h ('k') | chrome/browser/ui/views/find_bar_host.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/dropdown_bar_host.h" 5 #include "chrome/browser/ui/views/dropdown_bar_host.h"
6 6
7 #include "base/logging.h"
8 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
9 #include "ui/events/event.h"
10 #include "ui/views/view_constants_aura.h" 8 #include "ui/views/view_constants_aura.h"
11 #include "ui/views/widget/widget.h" 9 #include "ui/views/widget/widget.h"
12 10
13 using content::NativeWebKeyboardEvent;
14 using content::WebContents;
15
16 NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent(
17 const WebContents* contents,
18 const ui::KeyEvent& key_event) {
19 // NativeWebKeyboardEvent should take a const gfx::NativeEvent, which would
20 // prevent this casting.
21 ui::Event* ui_event =
22 static_cast<ui::Event*>(const_cast<ui::KeyEvent*>(&key_event));
23 return NativeWebKeyboardEvent(ui_event);
24 }
25
26 void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos, 11 void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos,
27 bool no_redraw) { 12 bool no_redraw) {
28 if (!host_->IsVisible()) 13 if (!host_->IsVisible())
29 host_->GetNativeView()->Show(); 14 host_->GetNativeView()->Show();
30 host_->GetNativeView()->SetBounds(new_pos); 15 host_->GetNativeView()->SetBounds(new_pos);
31 16
32 // The z-order of |host_| is controlled by the view specified via 17 // The z-order of |host_| is controlled by the view specified via
33 // views::kHostViewKey. 18 // views::kHostViewKey.
34 } 19 }
35 20
36 void DropdownBarHost::SetHostViewNative(views::View* host_view) { 21 void DropdownBarHost::SetHostViewNative(views::View* host_view) {
37 host_->GetNativeView()->SetProperty(views::kHostViewKey, host_view); 22 host_->GetNativeView()->SetProperty(views::kHostViewKey, host_view);
38 } 23 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/dropdown_bar_host.h ('k') | chrome/browser/ui/views/find_bar_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698