| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/metro_viewer/chrome_metro_viewer_process_host_aurawin.h
" | 5 #include "chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h
" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browser_process_platform_part_aurawin.h" | 10 #include "chrome/browser/browser_process_platform_part_aurawin.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 Browser* browser = chrome::FindOrCreateTabbedBrowser( | 50 Browser* browser = chrome::FindOrCreateTabbedBrowser( |
| 51 ProfileManager::GetDefaultProfileOrOffTheRecord(), | 51 ProfileManager::GetDefaultProfileOrOffTheRecord(), |
| 52 chrome::HOST_DESKTOP_TYPE_ASH); | 52 chrome::HOST_DESKTOP_TYPE_ASH); |
| 53 browser->OpenURL(content::OpenURLParams( | 53 browser->OpenURL(content::OpenURLParams( |
| 54 GURL(url), content::Referrer(), NEW_FOREGROUND_TAB, | 54 GURL(url), content::Referrer(), NEW_FOREGROUND_TAB, |
| 55 content::PAGE_TRANSITION_TYPED, false)); | 55 content::PAGE_TRANSITION_TYPED, false)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| 59 | 59 |
| 60 ChromeMetroViewerProcessHost::ChromeMetroViewerProcessHost( | 60 ChromeMetroViewerProcessHost::ChromeMetroViewerProcessHost() |
| 61 const std::string& ipc_channel_name) | 61 : MetroViewerProcessHost( |
| 62 : MetroViewerProcessHost( | 62 content::BrowserThread::GetMessageLoopProxyForThread( |
| 63 ipc_channel_name, | 63 content::BrowserThread::IO)) { |
| 64 content::BrowserThread::GetMessageLoopProxyForThread( | |
| 65 content::BrowserThread::IO)) { | |
| 66 g_browser_process->AddRefModule(); | 64 g_browser_process->AddRefModule(); |
| 67 } | 65 } |
| 68 | 66 |
| 69 void ChromeMetroViewerProcessHost::OnChannelError() { | 67 void ChromeMetroViewerProcessHost::OnChannelError() { |
| 70 // TODO(cpu): At some point we only close the browser. Right now this | 68 // TODO(cpu): At some point we only close the browser. Right now this |
| 71 // is very convenient for developing. | 69 // is very convenient for developing. |
| 72 DLOG(INFO) << "viewer channel error : Quitting browser"; | 70 DLOG(INFO) << "viewer channel error : Quitting browser"; |
| 73 aura::RemoteRootWindowHostWin::Instance()->Disconnected(); | 71 aura::RemoteRootWindowHostWin::Instance()->Disconnected(); |
| 74 g_browser_process->ReleaseModule(); | 72 g_browser_process->ReleaseModule(); |
| 75 CloseOpenAshBrowsers(); | 73 CloseOpenAshBrowsers(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 ProfileManager::GetDefaultProfileOrOffTheRecord())-> | 110 ProfileManager::GetDefaultProfileOrOffTheRecord())-> |
| 113 GetDefaultSearchProvider(); | 111 GetDefaultSearchProvider(); |
| 114 if (default_provider) { | 112 if (default_provider) { |
| 115 const TemplateURLRef& search_url = default_provider->url_ref(); | 113 const TemplateURLRef& search_url = default_provider->url_ref(); |
| 116 DCHECK(search_url.SupportsReplacement()); | 114 DCHECK(search_url.SupportsReplacement()); |
| 117 GURL request_url = GURL(search_url.ReplaceSearchTerms( | 115 GURL request_url = GURL(search_url.ReplaceSearchTerms( |
| 118 TemplateURLRef::SearchTermsArgs(search_string))); | 116 TemplateURLRef::SearchTermsArgs(search_string))); |
| 119 OpenURL(request_url); | 117 OpenURL(request_url); |
| 120 } | 118 } |
| 121 } | 119 } |
| OLD | NEW |