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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 10073014: Add more functionality to WebView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_view.cc
===================================================================
--- chrome/browser/ui/views/frame/browser_view.cc (revision 132579)
+++ chrome/browser/ui/views/frame/browser_view.cc (working copy)
@@ -93,6 +93,7 @@
#include "ui/gfx/sys_color_change_listener.h"
#include "ui/ui_controls/ui_controls.h"
#include "ui/views/controls/single_split_view.h"
+#include "ui/views/controls/webview/webview.h"
#include "ui/views/events/event.h"
#include "ui/views/focus/external_focus_tracker.h"
#include "ui/views/focus/view_storage.h"
@@ -1200,7 +1201,7 @@
}
void BrowserView::WebContentsFocused(WebContents* contents) {
- contents_container_->WebContentsFocused(contents);
+ contents_container_->OnWebContentsFocused(contents);
}
void BrowserView::ShowPageInfo(Profile* profile,
@@ -1313,10 +1314,12 @@
}
void BrowserView::ShowInstant(TabContentsWrapper* preview) {
- if (!preview_container_)
- preview_container_ = new TabContentsContainer();
+ if (!preview_container_) {
+ preview_container_ = new views::WebView(browser_->profile());
+ preview_container_->set_id(VIEW_ID_TAB_CONTAINER);
+ }
contents_->SetPreview(preview_container_, preview->web_contents());
- preview_container_->ChangeWebContents(preview->web_contents());
+ preview_container_->SetWebContents(preview->web_contents());
}
void BrowserView::HideInstant() {
@@ -1324,7 +1327,7 @@
return;
// The contents must be changed before SetPreview is invoked.
- preview_container_->ChangeWebContents(NULL);
+ preview_container_->SetWebContents(NULL);
contents_->SetPreview(NULL, NULL);
delete preview_container_;
preview_container_ = NULL;
@@ -1372,7 +1375,7 @@
}
views::View* BrowserView::GetTabContentsContainerView() const {
- return contents_container_->GetFocusView();
+ return contents_container_;
}
ToolbarView* BrowserView::GetToolbarView() const {
@@ -1390,7 +1393,7 @@
// We need to reset the current tab contents to NULL before it gets
// freed. This is because the focus manager performs some operations
// on the selected TabContents when it is removed.
- contents_container_->ChangeWebContents(NULL);
+ contents_container_->SetWebContents(NULL);
infobar_container_->ChangeTabContents(NULL);
UpdateDevToolsForContents(NULL);
}
@@ -1422,9 +1425,9 @@
// If 'preview' is becoming active, swap the 'active' and 'preview' and
// delete what was the active.
contents_->MakePreviewContentsActiveContents();
- TabContentsContainer* old_container = contents_container_;
+ views::WebView* old_container = contents_container_;
contents_container_ = preview_container_;
- old_container->ChangeWebContents(NULL);
+ old_container->SetWebContents(NULL);
delete old_container;
preview_container_ = NULL;
}
@@ -1900,7 +1903,8 @@
infobar_container_ = new InfoBarContainerView(this);
AddChildView(infobar_container_);
- contents_container_ = new TabContentsContainer;
+ contents_container_ = new views::WebView(browser_->profile());
+ contents_container_->set_id(VIEW_ID_TAB_CONTAINER);
contents_ = new ContentsContainer(contents_container_);
SkColor bg_color = GetWidget()->GetThemeProvider()->
@@ -2414,7 +2418,7 @@
// we don't want any TabContents to be attached, so that we
// avoid an unnecessary resize and re-layout of a TabContents.
if (change_tab_contents)
- contents_container_->ChangeWebContents(NULL);
+ contents_container_->SetWebContents(NULL);
infobar_container_->ChangeTabContents(new_contents->infobar_tab_helper());
if (bookmark_bar_view_.get()) {
bookmark_bar_view_->SetBookmarkBarState(
@@ -2423,7 +2427,7 @@
}
UpdateUIForContents(new_contents);
if (change_tab_contents)
- contents_container_->ChangeWebContents(new_contents->web_contents());
+ contents_container_->SetWebContents(new_contents->web_contents());
UpdateDevToolsForContents(new_contents);
// TODO(beng): This should be called automatically by ChangeWebContents, but I

Powered by Google App Engine
This is Rietveld 408576698