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

Side by Side Diff: chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc

Issue 10868072: Make TabContents ctor private; poke hole for existing callers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: all green Created 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/constrained_web_dialog_delegate_base.h" 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/constrained_window.h" 10 #include "chrome/browser/ui/constrained_window.h"
(...skipping 15 matching lines...) Expand all
26 WebDialogDelegate* delegate, 26 WebDialogDelegate* delegate,
27 WebDialogWebContentsDelegate* tab_delegate) 27 WebDialogWebContentsDelegate* tab_delegate)
28 : WebDialogWebContentsDelegate(profile, new ChromeWebContentsHandler), 28 : WebDialogWebContentsDelegate(profile, new ChromeWebContentsHandler),
29 web_dialog_delegate_(delegate), 29 web_dialog_delegate_(delegate),
30 window_(NULL), 30 window_(NULL),
31 closed_via_webui_(false), 31 closed_via_webui_(false),
32 release_tab_on_close_(false) { 32 release_tab_on_close_(false) {
33 CHECK(delegate); 33 CHECK(delegate);
34 WebContents* web_contents = 34 WebContents* web_contents =
35 WebContents::Create(profile, NULL, MSG_ROUTING_NONE, NULL); 35 WebContents::Create(profile, NULL, MSG_ROUTING_NONE, NULL);
36 tab_.reset(new TabContents(web_contents)); 36 tab_.reset(TabContents::Factory::CreateTabContents(web_contents));
37 if (tab_delegate) { 37 if (tab_delegate) {
38 override_tab_delegate_.reset(tab_delegate); 38 override_tab_delegate_.reset(tab_delegate);
39 web_contents->SetDelegate(tab_delegate); 39 web_contents->SetDelegate(tab_delegate);
40 } else { 40 } else {
41 web_contents->SetDelegate(this); 41 web_contents->SetDelegate(this);
42 } 42 }
43 // Set |this| as a delegate so the ConstrainedWebDialogUI can retrieve it. 43 // Set |this| as a delegate so the ConstrainedWebDialogUI can retrieve it.
44 ConstrainedWebDialogUI::SetConstrainedDelegate(web_contents, this); 44 ConstrainedWebDialogUI::SetConstrainedDelegate(web_contents, this);
45 45
46 web_contents->GetController().LoadURL(delegate->GetDialogContentURL(), 46 web_contents->GetController().LoadURL(delegate->GetDialogContentURL(),
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 TabContents* ConstrainedWebDialogDelegateBase::tab() { 93 TabContents* ConstrainedWebDialogDelegateBase::tab() {
94 return tab_.get(); 94 return tab_.get();
95 } 95 }
96 96
97 void ConstrainedWebDialogDelegateBase::HandleKeyboardEvent( 97 void ConstrainedWebDialogDelegateBase::HandleKeyboardEvent(
98 content::WebContents* source, 98 content::WebContents* source,
99 const NativeWebKeyboardEvent& event) { 99 const NativeWebKeyboardEvent& event) {
100 } 100 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_contents_handler.cc ('k') | chrome/browser/ui/webui/web_ui_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698