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

Side by Side Diff: chrome/browser/tab_contents/tab_contents_view.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/tab_contents_view.h" 5 #include "chrome/browser/tab_contents/tab_contents_view.h"
6 6
7 #include "chrome/browser/renderer_host/render_process_host.h" 7 #include "chrome/browser/renderer_host/render_process_host.h"
8 #include "chrome/browser/renderer_host/render_view_host.h" 8 #include "chrome/browser/renderer_host/render_view_host.h"
9 #include "chrome/browser/renderer_host/render_widget_host.h" 9 #include "chrome/browser/renderer_host/render_widget_host.h"
10 #include "chrome/browser/renderer_host/render_view_host_delegate.h" 10 #include "chrome/browser/renderer_host/render_view_host_delegate.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 } 60 }
61 61
62 void TabContentsView::ShowCreatedWidget(int route_id, 62 void TabContentsView::ShowCreatedWidget(int route_id,
63 const gfx::Rect& initial_pos) { 63 const gfx::Rect& initial_pos) {
64 RenderWidgetHostView* widget_host_view = 64 RenderWidgetHostView* widget_host_view =
65 delegate_view_helper_.GetCreatedWidget(route_id); 65 delegate_view_helper_.GetCreatedWidget(route_id);
66 ShowCreatedWidgetInternal(widget_host_view, initial_pos); 66 ShowCreatedWidgetInternal(widget_host_view, initial_pos);
67 } 67 }
68 68
69 void TabContentsView::Activate() {
70 tab_contents_->delegate()->Activate();
71 }
72
73 void TabContentsView::Deactivate() {
74 tab_contents_->delegate()->Deactivate();
75 }
76
69 bool TabContentsView::PreHandleKeyboardEvent( 77 bool TabContentsView::PreHandleKeyboardEvent(
70 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { 78 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) {
71 return tab_contents_->delegate() && 79 return tab_contents_->delegate() &&
72 tab_contents_->delegate()->PreHandleKeyboardEvent( 80 tab_contents_->delegate()->PreHandleKeyboardEvent(
73 event, is_keyboard_shortcut); 81 event, is_keyboard_shortcut);
74 } 82 }
75 83
76 void TabContentsView::UpdatePreferredSize(const gfx::Size& pref_size) { 84 void TabContentsView::UpdatePreferredSize(const gfx::Size& pref_size) {
77 if (tab_contents_->delegate()) 85 if (tab_contents_->delegate())
78 tab_contents_->delegate()->UpdatePreferredSize(pref_size); 86 tab_contents_->delegate()->UpdatePreferredSize(pref_size);
(...skipping 12 matching lines...) Expand all
91 99
92 void TabContentsView::ShowCreatedWidgetInternal( 100 void TabContentsView::ShowCreatedWidgetInternal(
93 RenderWidgetHostView* widget_host_view, const gfx::Rect& initial_pos) { 101 RenderWidgetHostView* widget_host_view, const gfx::Rect& initial_pos) {
94 if (tab_contents_->delegate()) 102 if (tab_contents_->delegate())
95 tab_contents_->delegate()->RenderWidgetShowing(); 103 tab_contents_->delegate()->RenderWidgetShowing();
96 104
97 widget_host_view->InitAsPopup(tab_contents_->GetRenderWidgetHostView(), 105 widget_host_view->InitAsPopup(tab_contents_->GetRenderWidgetHostView(),
98 initial_pos); 106 initial_pos);
99 widget_host_view->GetRenderWidgetHost()->Init(); 107 widget_host_view->GetRenderWidgetHost()->Init();
100 } 108 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_view.h ('k') | chrome/browser/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698