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

Side by Side Diff: ui/views/controls/webview/webview.cc

Issue 1159033008: Refactor ViewsDelegate singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 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
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 "ui/views/controls/webview/webview.h" 5 #include "ui/views/controls/webview/webview.h"
6 6
7 #include "content/public/browser/browser_accessibility_state.h" 7 #include "content/public/browser/browser_accessibility_state.h"
8 #include "content/public/browser/browser_context.h" 8 #include "content/public/browser/browser_context.h"
9 #include "content/public/browser/navigation_controller.h" 9 #include "content/public/browser/navigation_controller.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 400
401 #if defined(OS_CHROMEOS) 401 #if defined(OS_CHROMEOS)
402 if (web_contents()) 402 if (web_contents())
403 NotifyAccessibilityEvent(ui::AX_EVENT_CHILDREN_CHANGED, false); 403 NotifyAccessibilityEvent(ui::AX_EVENT_CHILDREN_CHANGED, false);
404 #endif // defined OS_CHROMEOS 404 #endif // defined OS_CHROMEOS
405 } 405 }
406 406
407 content::WebContents* WebView::CreateWebContents( 407 content::WebContents* WebView::CreateWebContents(
408 content::BrowserContext* browser_context) { 408 content::BrowserContext* browser_context) {
409 content::WebContents* contents = NULL; 409 content::WebContents* contents = NULL;
410 if (ViewsDelegate::views_delegate) { 410 if (ViewsDelegate::GetInstance()) {
411 contents = ViewsDelegate::views_delegate->CreateWebContents( 411 contents =
412 browser_context, NULL); 412 ViewsDelegate::GetInstance()->CreateWebContents(browser_context, NULL);
413 } 413 }
414 414
415 if (!contents) { 415 if (!contents) {
416 content::WebContents::CreateParams create_params( 416 content::WebContents::CreateParams create_params(
417 browser_context, NULL); 417 browser_context, NULL);
418 return content::WebContents::Create(create_params); 418 return content::WebContents::Create(create_params);
419 } 419 }
420 420
421 return contents; 421 return contents;
422 } 422 }
423 423
424 } // namespace views 424 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698