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

Side by Side Diff: chrome/browser/views/dom_view.cc

Issue 114059: Refactors HWNDView, NativeViewHostGtk and NativeViewHost so that they match t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « chrome/browser/views/dom_view.h ('k') | chrome/browser/views/location_bar_view.h » ('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) 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/views/dom_view.h" 5 #include "chrome/browser/views/dom_view.h"
6 6
7 #include "chrome/browser/tab_contents/tab_contents.h" 7 #include "chrome/browser/tab_contents/tab_contents.h"
8 #include "views/focus/focus_manager.h" 8 #include "views/focus/focus_manager.h"
9 9
10 DOMView::DOMView() : initialized_(false), tab_contents_(NULL) { 10 DOMView::DOMView() : initialized_(false), tab_contents_(NULL) {
11 SetFocusable(true); 11 SetFocusable(true);
12 } 12 }
13 13
14 DOMView::~DOMView() { 14 DOMView::~DOMView() {
15 if (tab_contents_.get()) 15 if (tab_contents_.get())
16 Detach(); 16 Detach();
17 } 17 }
18 18
19 bool DOMView::Init(Profile* profile, SiteInstance* instance) { 19 bool DOMView::Init(Profile* profile, SiteInstance* instance) {
20 if (initialized_) 20 if (initialized_)
21 return true; 21 return true;
22 22
23 initialized_ = true; 23 initialized_ = true;
24 tab_contents_.reset(new TabContents(profile, instance, 24 tab_contents_.reset(new TabContents(profile, instance,
25 MSG_ROUTING_NONE, NULL)); 25 MSG_ROUTING_NONE, NULL));
26 views::HWNDView::Attach(tab_contents_->GetNativeView()); 26 views::NativeViewHost::Attach(tab_contents_->GetNativeView());
27 return true; 27 return true;
28 } 28 }
29 29
30 void DOMView::LoadURL(const GURL& url) { 30 void DOMView::LoadURL(const GURL& url) {
31 DCHECK(initialized_); 31 DCHECK(initialized_);
32 tab_contents_->controller().LoadURL(url, GURL(), PageTransition::START_PAGE); 32 tab_contents_->controller().LoadURL(url, GURL(), PageTransition::START_PAGE);
33 } 33 }
34 34
35 bool DOMView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { 35 bool DOMView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) {
36 // Don't move the focus to the next view when tab is pressed, we want the 36 // Don't move the focus to the next view when tab is pressed, we want the
37 // key event to be propagated to the render view for doing the tab traversal 37 // key event to be propagated to the render view for doing the tab traversal
38 // there. 38 // there.
39 return views::FocusManager::IsTabTraversalKeyEvent(e); 39 return views::FocusManager::IsTabTraversalKeyEvent(e);
40 } 40 }
OLDNEW
« no previous file with comments | « chrome/browser/views/dom_view.h ('k') | chrome/browser/views/location_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698