Esempio n. 1
0
void
FrameworkView::LaunchActivated(ComPtr<ILaunchActivatedEventArgs>& aArgs, bool aStartup)
{
  if (!aArgs)
    return;
  HString data;
  AssertHRESULT(aArgs->get_Arguments(data.GetAddressOf()));
  if (WindowsIsStringEmpty(data.Get()))
    return;

  // If we're being launched from a secondary tile then we have a 2nd command line param of -url
  // and a third of the secondary tile.  We want it in sActivationURI so that browser.js will
  // load it in without showing the start UI.
  int argc;
  unsigned int length;
  LPWSTR* argv = CommandLineToArgvW(data.GetRawBuffer(&length), &argc);
  if (aStartup && argc == 2 && !wcsicmp(argv[0], L"-url")) {
    WindowsCreateString(argv[1], wcslen(argv[1]), &sActivationURI);
  } else {
    // Some other command line or this is not a startup.
    // If it is startup we process it later when XPCOM is initialilzed.
    mActivationCommandLine = data.GetRawBuffer(&length);
    if (!aStartup) {
      ProcessLaunchArguments();
    }
  }
}
Esempio n. 2
0
HRESULT
FrameworkView::ActivateView()
{
    LogFunction();

    UpdateWidgetSizeAndPosition();

    nsIntRegion region(nsIntRect(0, 0, mWindowBounds.width, mWindowBounds.height));
    mWidget->Paint(region);

    // Activate the window, this kills the splash screen
    mWindow->Activate();

    ProcessLaunchArguments();
    AddEventHandlers();
    SetupContracts();

    return S_OK;
}