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

Unified Diff: chrome/browser/ui/browser_init_win.cc

Issue 10383114: Rename BrowserInit to StartupBrowserCreator, and move into startup subdir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_init_win.h ('k') | chrome/browser/ui/panels/panel_app_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_init_win.cc
===================================================================
--- chrome/browser/ui/browser_init_win.cc (revision 136345)
+++ chrome/browser/ui/browser_init_win.cc (working copy)
@@ -1,64 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/browser_init_win.h"
-
-#include "base/logging.h"
-#include "base/win/metro.h"
-
-#include "chrome/browser/search_engines/template_url.h"
-#include "chrome/browser/search_engines/template_url_service.h"
-#include "chrome/browser/search_engines/template_url_service_factory.h"
-
-namespace browser {
-
-// Metro driver exports for getting the launch type, initial url, initial
-// search term, etc.
-extern "C" {
-typedef const wchar_t* (*GetInitialUrl)();
-typedef const wchar_t* (*GetInitialSearchString)();
-typedef base::win::MetroLaunchType (*GetLaunchType)(
- base::win::MetroPreviousExecutionState* previous_state);
-}
-
-GURL GetURLToOpen(Profile* profile) {
- HMODULE metro = base::win::GetMetroModule();
- if (!metro)
- return GURL();
-
- GetLaunchType get_launch_type = reinterpret_cast<GetLaunchType>(
- ::GetProcAddress(metro, "GetLaunchType"));
- DCHECK(get_launch_type);
-
- base::win::MetroLaunchType launch_type = get_launch_type(NULL);
-
- if (launch_type == base::win::PROTOCOL) {
- GetInitialUrl initial_metro_url = reinterpret_cast<GetInitialUrl>(
- ::GetProcAddress(metro, "GetInitialUrl"));
- DCHECK(initial_metro_url);
- const wchar_t* initial_url = initial_metro_url();
- if (initial_url)
- return GURL(initial_url);
- } else if (launch_type == base::win::SEARCH) {
- GetInitialSearchString initial_search_string =
- reinterpret_cast<GetInitialSearchString>(
- ::GetProcAddress(metro, "GetInitialSearchString"));
- DCHECK(initial_search_string);
- string16 search_string = initial_search_string();
-
- const TemplateURL* default_provider =
- TemplateURLServiceFactory::GetForProfile(profile)->
- GetDefaultSearchProvider();
- if (default_provider) {
- const TemplateURLRef& search_url = default_provider->url_ref();
- DCHECK(search_url.SupportsReplacement());
- return GURL(search_url.ReplaceSearchTerms(search_string,
- TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()));
- }
- }
- return GURL();
-}
-
-} // namespace browser
-
« no previous file with comments | « chrome/browser/ui/browser_init_win.h ('k') | chrome/browser/ui/panels/panel_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698