summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
Diffstat (limited to 'win8')
-rw-r--r--win8/metro_driver/chrome_url_launch_handler.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/win8/metro_driver/chrome_url_launch_handler.cc b/win8/metro_driver/chrome_url_launch_handler.cc
index 7a9a607..897276a 100644
--- a/win8/metro_driver/chrome_url_launch_handler.cc
+++ b/win8/metro_driver/chrome_url_launch_handler.cc
@@ -102,6 +102,10 @@ void ChromeUrlLaunchHandler::HandleProtocolLaunch(
// are encoded in |launch_args| they are ignored.
string16 ChromeUrlLaunchHandler::GetUrlFromLaunchArgs(
const string16& launch_args) {
+ if (launch_args == L"opennewwindow") {
+ VLOG(1) << "Returning new tab url";
+ return L"chrome://newtab";
+ }
string16 dummy_command_line(L"dummy.exe ");
dummy_command_line.append(launch_args);
CommandLine command_line = CommandLine::FromString(dummy_command_line);
@@ -179,6 +183,11 @@ void ChromeUrlLaunchHandler::InitiateNavigationOrSearchRequest(
DVLOG(1) << (url ? url : L"NULL url");
DVLOG(1) << (search_string ? search_string : L"NULL search string");
+ if (globals.host_windows.empty()) {
+ DVLOG(1) << "No chrome windows registered. Ignoring nav request";
+ return;
+ }
+
// Custom registered message to navigate or search in chrome. WPARAM
// points to the URL and LPARAM contains the search string. They are
// mutually exclusive.