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

Side by Side Diff: chrome/browser/ui/browser_tab_restore_service_delegate.cc

Issue 187443008: Elim Browser::AppType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and add non trusted type test Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_navigator_browsertest.cc ('k') | chrome/browser/ui/chrome_pages.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) 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/browser_tab_restore_service_delegate.h" 5 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
6 6
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_commands.h" 8 #include "chrome/browser/ui/browser_commands.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_tabrestore.h" 10 #include "chrome/browser/ui/browser_tabrestore.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 TabRestoreServiceDelegate* TabRestoreServiceDelegate::Create( 87 TabRestoreServiceDelegate* TabRestoreServiceDelegate::Create(
88 Profile* profile, 88 Profile* profile,
89 chrome::HostDesktopType host_desktop_type, 89 chrome::HostDesktopType host_desktop_type,
90 const std::string& app_name) { 90 const std::string& app_name) {
91 Browser* browser; 91 Browser* browser;
92 if (app_name.empty()) { 92 if (app_name.empty()) {
93 browser = new Browser(Browser::CreateParams(profile, host_desktop_type)); 93 browser = new Browser(Browser::CreateParams(profile, host_desktop_type));
94 } else { 94 } else {
95 browser = new Browser( 95 browser = new Browser(
96 Browser::CreateParams::CreateForApp( 96 Browser::CreateParams::CreateForApp(
97 Browser::TYPE_POPUP, app_name, gfx::Rect(), profile, 97 Browser::TYPE_TRUSTED_POPUP, app_name, gfx::Rect(), profile,
98 host_desktop_type)); 98 host_desktop_type));
99 } 99 }
100 if (browser) 100 if (browser)
101 return browser->tab_restore_service_delegate(); 101 return browser->tab_restore_service_delegate();
102 else 102 else
103 return NULL; 103 return NULL;
104 } 104 }
105 105
106 // static 106 // static
107 TabRestoreServiceDelegate* 107 TabRestoreServiceDelegate*
108 TabRestoreServiceDelegate::FindDelegateForWebContents( 108 TabRestoreServiceDelegate::FindDelegateForWebContents(
109 const WebContents* contents) { 109 const WebContents* contents) {
110 Browser* browser = chrome::FindBrowserWithWebContents(contents); 110 Browser* browser = chrome::FindBrowserWithWebContents(contents);
111 return browser ? browser->tab_restore_service_delegate() : NULL; 111 return browser ? browser->tab_restore_service_delegate() : NULL;
112 } 112 }
113 113
114 // static 114 // static
115 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID( 115 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID(
116 SessionID::id_type desired_id, 116 SessionID::id_type desired_id,
117 chrome::HostDesktopType host_desktop_type) { 117 chrome::HostDesktopType host_desktop_type) {
118 Browser* browser = chrome::FindBrowserWithID(desired_id); 118 Browser* browser = chrome::FindBrowserWithID(desired_id);
119 return (browser && browser->host_desktop_type() == host_desktop_type) ? 119 return (browser && browser->host_desktop_type() == host_desktop_type) ?
120 browser->tab_restore_service_delegate() : NULL; 120 browser->tab_restore_service_delegate() : NULL;
121 } 121 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_navigator_browsertest.cc ('k') | chrome/browser/ui/chrome_pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698