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

Side by Side Diff: ui/app_list/demo/app_list_demo_views.cc

Issue 1432143002: Track where WebContents are created in order to better understand issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/browser/web_contents_source.h"
10 #include "content/public/common/content_switches.h" 11 #include "content/public/common/content_switches.h"
11 #include "ui/app_list/test/app_list_test_model.h" 12 #include "ui/app_list/test/app_list_test_model.h"
12 #include "ui/app_list/test/app_list_test_view_delegate.h" 13 #include "ui/app_list/test/app_list_test_view_delegate.h"
13 #include "ui/app_list/views/app_list_view.h" 14 #include "ui/app_list/views/app_list_view.h"
14 #include "ui/base/resource/resource_bundle.h" 15 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/resources/grit/ui_resources.h" 16 #include "ui/resources/grit/ui_resources.h"
16 #include "ui/views/controls/webview/webview.h" 17 #include "ui/views/controls/webview/webview.h"
17 #include "ui/views_content_client/views_content_client.h" 18 #include "ui/views_content_client/views_content_client.h"
18 19
19 #if defined(OS_WIN) 20 #if defined(OS_WIN)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void DemoAppListViewDelegate::ViewClosing() { 89 void DemoAppListViewDelegate::ViewClosing() {
89 base::MessageLoop* message_loop = base::MessageLoopForUI::current(); 90 base::MessageLoop* message_loop = base::MessageLoopForUI::current();
90 message_loop->DeleteSoon(FROM_HERE, this); 91 message_loop->DeleteSoon(FROM_HERE, this);
91 message_loop->QuitWhenIdle(); 92 message_loop->QuitWhenIdle();
92 } 93 }
93 94
94 views::View* DemoAppListViewDelegate::CreateStartPageWebView( 95 views::View* DemoAppListViewDelegate::CreateStartPageWebView(
95 const gfx::Size& size) { 96 const gfx::Size& size) {
96 web_contents_.reset(content::WebContents::Create( 97 web_contents_.reset(content::WebContents::Create(
97 content::WebContents::CreateParams(browser_context_))); 98 content::WebContents::CreateParams(browser_context_)));
99 WebContentsSource::CreateForWebContentsAndLocation(web_contents_.get(),
100 FROM_HERE);
98 web_contents_->GetController().LoadURL(GURL("http://www.google.com/"), 101 web_contents_->GetController().LoadURL(GURL("http://www.google.com/"),
99 content::Referrer(), 102 content::Referrer(),
100 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 103 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
101 std::string()); 104 std::string());
102 views::WebView* web_view = new views::WebView( 105 views::WebView* web_view = new views::WebView(
103 web_contents_->GetBrowserContext()); 106 web_contents_->GetBrowserContext());
104 web_view->SetPreferredSize(size); 107 web_view->SetPreferredSize(size);
105 web_view->SetWebContents(web_contents_.get()); 108 web_view->SetWebContents(web_contents_.get());
106 return web_view; 109 return web_view;
107 } 110 }
(...skipping 15 matching lines...) Expand all
123 content::InitializeSandboxInfo(&sandbox_info); 126 content::InitializeSandboxInfo(&sandbox_info);
124 ui::ViewsContentClient views_content_client(instance, &sandbox_info); 127 ui::ViewsContentClient views_content_client(instance, &sandbox_info);
125 #else 128 #else
126 int main(int argc, const char** argv) { 129 int main(int argc, const char** argv) {
127 ui::ViewsContentClient views_content_client(argc, argv); 130 ui::ViewsContentClient views_content_client(argc, argv);
128 #endif 131 #endif
129 132
130 views_content_client.set_task(base::Bind(&ShowAppList)); 133 views_content_client.set_task(base::Bind(&ShowAppList));
131 return views_content_client.RunMain(); 134 return views_content_client.RunMain();
132 } 135 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698