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

Side by Side Diff: ui/views/controls/webview/web_dialog_view.cc

Issue 303543004: MacViews: views_examples_with_content_exe working! Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add files Created 6 years, 7 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 | « ui/views/controls/menu/menu_host.cc ('k') | ui/views/examples/examples.gyp » ('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 "ui/views/controls/webview/web_dialog_view.h" 5 #include "ui/views/controls/webview/web_dialog_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 GetWidget()->SetBounds(pos); 273 GetWidget()->SetBounds(pos);
274 } 274 }
275 275
276 // A simplified version of BrowserView::HandleKeyboardEvent(). 276 // A simplified version of BrowserView::HandleKeyboardEvent().
277 // We don't handle global keyboard shortcuts here, but that's fine since 277 // We don't handle global keyboard shortcuts here, but that's fine since
278 // they're all browser-specific. (This may change in the future.) 278 // they're all browser-specific. (This may change in the future.)
279 void WebDialogView::HandleKeyboardEvent(content::WebContents* source, 279 void WebDialogView::HandleKeyboardEvent(content::WebContents* source,
280 const NativeWebKeyboardEvent& event) { 280 const NativeWebKeyboardEvent& event) {
281 if (!event.os_event) 281 if (!event.os_event)
282 return; 282 return;
283 #if defined(USE_AURA)
283 ui::KeyEvent aura_event(event.os_event->native_event(), false); 284 ui::KeyEvent aura_event(event.os_event->native_event(), false);
284 ui::EventHandler* event_handler = 285 ui::EventHandler* event_handler =
285 GetWidget()->native_widget()->GetEventHandler(); 286 GetWidget()->native_widget()->GetEventHandler();
286 287
287 DCHECK(event_handler); 288 DCHECK(event_handler);
288 if (event_handler) 289 if (event_handler)
289 event_handler->OnKeyEvent(&aura_event); 290 event_handler->OnKeyEvent(&aura_event);
290 291 #endif
291 } 292 }
292 293
293 void WebDialogView::CloseContents(WebContents* source) { 294 void WebDialogView::CloseContents(WebContents* source) {
294 close_contents_called_ = true; 295 close_contents_called_ = true;
295 bool close_dialog = false; 296 bool close_dialog = false;
296 OnCloseContents(source, &close_dialog); 297 OnCloseContents(source, &close_dialog);
297 if (close_dialog) 298 if (close_dialog)
298 OnDialogClosed(closed_via_webui_ ? dialog_close_retval_ : std::string()); 299 OnDialogClosed(closed_via_webui_ ? dialog_close_retval_ : std::string());
299 } 300 }
300 301
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 web_contents->SetDelegate(this); 349 web_contents->SetDelegate(this);
349 350
350 // Set the delegate. This must be done before loading the page. See 351 // Set the delegate. This must be done before loading the page. See
351 // the comment above WebDialogUI in its header file for why. 352 // the comment above WebDialogUI in its header file for why.
352 WebDialogUI::SetDelegate(web_contents, this); 353 WebDialogUI::SetDelegate(web_contents, this);
353 354
354 web_view_->LoadInitialURL(GetDialogContentURL()); 355 web_view_->LoadInitialURL(GetDialogContentURL());
355 } 356 }
356 357
357 } // namespace views 358 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_host.cc ('k') | ui/views/examples/examples.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698