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

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

Issue 3060045: Making window.focus() work in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 virtual void ShowCreatedWidget(int route_id, 100 virtual void ShowCreatedWidget(int route_id,
101 const gfx::Rect& initial_pos); 101 const gfx::Rect& initial_pos);
102 virtual void ShowContextMenu(const ContextMenuParams& params); 102 virtual void ShowContextMenu(const ContextMenuParams& params);
103 virtual void StartDragging(const WebDropData& drop_data, 103 virtual void StartDragging(const WebDropData& drop_data,
104 WebDragOperationsMask operations_allowed, 104 WebDragOperationsMask operations_allowed,
105 const SkBitmap& image, 105 const SkBitmap& image,
106 const gfx::Point& image_offset); 106 const gfx::Point& image_offset);
107 virtual void UpdateDragCursor(WebDragOperation operation); 107 virtual void UpdateDragCursor(WebDragOperation operation);
108 virtual void GotFocus(); 108 virtual void GotFocus();
109 virtual void TakeFocus(bool reverse); 109 virtual void TakeFocus(bool reverse);
110 virtual void Activate();
111 virtual void Deactivate();
110 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, 112 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
111 bool* is_keyboard_shortcut); 113 bool* is_keyboard_shortcut);
112 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); 114 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
113 virtual void HandleMouseMove(); 115 virtual void HandleMouseMove();
114 virtual void HandleMouseDown(); 116 virtual void HandleMouseDown();
115 virtual void HandleMouseLeave(); 117 virtual void HandleMouseLeave();
116 virtual void OnFindReply(int request_id, 118 virtual void OnFindReply(int request_id,
117 int number_of_matches, 119 int number_of_matches,
118 const gfx::Rect& selection_rect, 120 const gfx::Rect& selection_rect,
119 int active_match_ordinal, 121 int active_match_ordinal,
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 void InterstitialPage::InterstitialPageRVHViewDelegate::UpdatePreferredSize( 604 void InterstitialPage::InterstitialPageRVHViewDelegate::UpdatePreferredSize(
603 const gfx::Size& pref_size) { 605 const gfx::Size& pref_size) {
604 } 606 }
605 607
606 void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus( 608 void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus(
607 bool reverse) { 609 bool reverse) {
608 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) 610 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
609 interstitial_page_->tab()->GetViewDelegate()->TakeFocus(reverse); 611 interstitial_page_->tab()->GetViewDelegate()->TakeFocus(reverse);
610 } 612 }
611 613
614 void InterstitialPage::InterstitialPageRVHViewDelegate::Activate() {
615 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
616 interstitial_page_->tab()->GetViewDelegate()->Activate();
617 }
618
619 void InterstitialPage::InterstitialPageRVHViewDelegate::Deactivate() {
620 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
621 interstitial_page_->tab()->GetViewDelegate()->Deactivate();
622 }
623
612 bool InterstitialPage::InterstitialPageRVHViewDelegate::PreHandleKeyboardEvent( 624 bool InterstitialPage::InterstitialPageRVHViewDelegate::PreHandleKeyboardEvent(
613 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { 625 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) {
614 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) 626 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
615 return interstitial_page_->tab()->GetViewDelegate()->PreHandleKeyboardEvent( 627 return interstitial_page_->tab()->GetViewDelegate()->PreHandleKeyboardEvent(
616 event, is_keyboard_shortcut); 628 event, is_keyboard_shortcut);
617 return false; 629 return false;
618 } 630 }
619 631
620 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleKeyboardEvent( 632 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleKeyboardEvent(
621 const NativeWebKeyboardEvent& event) { 633 const NativeWebKeyboardEvent& event) {
(...skipping 17 matching lines...) Expand all
639 } 651 }
640 652
641 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( 653 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply(
642 int request_id, int number_of_matches, const gfx::Rect& selection_rect, 654 int request_id, int number_of_matches, const gfx::Rect& selection_rect,
643 int active_match_ordinal, bool final_update) { 655 int active_match_ordinal, bool final_update) {
644 } 656 }
645 657
646 int InterstitialPage::GetBrowserWindowID() const { 658 int InterstitialPage::GetBrowserWindowID() const {
647 return tab_->GetBrowserWindowID(); 659 return tab_->GetBrowserWindowID();
648 } 660 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/background_contents.h ('k') | chrome/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698