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

Side by Side Diff: chrome/browser/tab_contents/interstitial_page.cc

Issue 400012: Refactor the keyboard events handling code related to RenderViewHostDelegate:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/tab_contents/interstitial_page.h" 5 #include "chrome/browser/tab_contents/interstitial_page.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/thread.h" 10 #include "base/thread.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 bool user_gesture, 91 bool user_gesture,
92 const GURL& creator_url); 92 const GURL& creator_url);
93 virtual void ShowCreatedWidget(int route_id, 93 virtual void ShowCreatedWidget(int route_id,
94 const gfx::Rect& initial_pos); 94 const gfx::Rect& initial_pos);
95 virtual void ShowContextMenu(const ContextMenuParams& params); 95 virtual void ShowContextMenu(const ContextMenuParams& params);
96 virtual void StartDragging(const WebDropData& drop_data, 96 virtual void StartDragging(const WebDropData& drop_data,
97 WebDragOperationsMask operations_allowed); 97 WebDragOperationsMask operations_allowed);
98 virtual void UpdateDragCursor(WebDragOperation operation); 98 virtual void UpdateDragCursor(WebDragOperation operation);
99 virtual void GotFocus(); 99 virtual void GotFocus();
100 virtual void TakeFocus(bool reverse); 100 virtual void TakeFocus(bool reverse);
101 virtual bool IsReservedAccelerator(const NativeWebKeyboardEvent& event); 101 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
102 virtual bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); 102 bool* is_keyboard_shortcut);
103 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
103 virtual void HandleMouseEvent(); 104 virtual void HandleMouseEvent();
104 virtual void HandleMouseLeave(); 105 virtual void HandleMouseLeave();
105 virtual void OnFindReply(int request_id, 106 virtual void OnFindReply(int request_id,
106 int number_of_matches, 107 int number_of_matches,
107 const gfx::Rect& selection_rect, 108 const gfx::Rect& selection_rect,
108 int active_match_ordinal, 109 int active_match_ordinal,
109 bool final_update); 110 bool final_update);
110 virtual void UpdatePreferredSize(const gfx::Size& pref_size); 111 virtual void UpdatePreferredSize(const gfx::Size& pref_size);
111 112
112 private: 113 private:
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 void InterstitialPage::InterstitialPageRVHViewDelegate::UpdatePreferredSize( 580 void InterstitialPage::InterstitialPageRVHViewDelegate::UpdatePreferredSize(
580 const gfx::Size& pref_size) { 581 const gfx::Size& pref_size) {
581 } 582 }
582 583
583 void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus( 584 void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus(
584 bool reverse) { 585 bool reverse) {
585 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) 586 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
586 interstitial_page_->tab()->GetViewDelegate()->TakeFocus(reverse); 587 interstitial_page_->tab()->GetViewDelegate()->TakeFocus(reverse);
587 } 588 }
588 589
589 bool InterstitialPage::InterstitialPageRVHViewDelegate::IsReservedAccelerator( 590 bool InterstitialPage::InterstitialPageRVHViewDelegate::PreHandleKeyboardEvent(
590 const NativeWebKeyboardEvent& event) { 591 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) {
592 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
593 return interstitial_page_->tab()->GetViewDelegate()->PreHandleKeyboardEvent(
594 event, is_keyboard_shortcut);
591 return false; 595 return false;
592 } 596 }
593 597
594 bool InterstitialPage::InterstitialPageRVHViewDelegate::HandleKeyboardEvent( 598 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleKeyboardEvent(
595 const NativeWebKeyboardEvent& event) { 599 const NativeWebKeyboardEvent& event) {
596 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) 600 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
597 return interstitial_page_->tab()->GetViewDelegate()-> 601 interstitial_page_->tab()->GetViewDelegate()->HandleKeyboardEvent(event);
598 HandleKeyboardEvent(event);
599 return false;
600 } 602 }
601 603
602 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleMouseEvent() { 604 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleMouseEvent() {
603 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) 605 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
604 interstitial_page_->tab()->GetViewDelegate()->HandleMouseEvent(); 606 interstitial_page_->tab()->GetViewDelegate()->HandleMouseEvent();
605 } 607 }
606 608
607 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleMouseLeave() { 609 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleMouseLeave() {
608 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) 610 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
609 interstitial_page_->tab()->GetViewDelegate()->HandleMouseLeave(); 611 interstitial_page_->tab()->GetViewDelegate()->HandleMouseLeave();
610 } 612 }
611 613
612 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( 614 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply(
613 int request_id, int number_of_matches, const gfx::Rect& selection_rect, 615 int request_id, int number_of_matches, const gfx::Rect& selection_rect,
614 int active_match_ordinal, bool final_update) { 616 int active_match_ordinal, bool final_update) {
615 } 617 }
616 618
617 int InterstitialPage::GetBrowserWindowID() const { 619 int InterstitialPage::GetBrowserWindowID() const {
618 return tab_->GetBrowserWindowID(); 620 return tab_->GetBrowserWindowID();
619 } 621 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_mac.mm ('k') | chrome/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698