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

Unified Diff: win8/metro_driver/chrome_url_launch_handler.h

Issue 10875008: Integrate the Windows 8 code into the Chromium tree. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove conflicting OWNERS file. Created 8 years, 3 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 | « win8/metro_driver/chrome_app_view.cc ('k') | win8/metro_driver/chrome_url_launch_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/chrome_url_launch_handler.h
diff --git a/win8/metro_driver/chrome_url_launch_handler.h b/win8/metro_driver/chrome_url_launch_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..d8c7ed01b7b20f2fdeaaed72bdd61156b24e5baf
--- /dev/null
+++ b/win8/metro_driver/chrome_url_launch_handler.h
@@ -0,0 +1,58 @@
+// 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.
+
+#ifndef CHROME_BROWSER_UI_METRO_DRIVER_CHROME_URL_LAUNCH_HANDLER_H_
+#define CHROME_BROWSER_UI_METRO_DRIVER_CHROME_URL_LAUNCH_HANDLER_H_
+
+#include <string>
+#include <windows.applicationmodel.core.h>
+#include <Windows.applicationModel.search.h>
+#include <windows.ui.core.h>
+
+#include "winrt_utils.h"
+
+// This class handles the various flavors of URL launches in metro, i.e.
+// via the search charm, via a url being navigated from a metro app, etc.
+class ChromeUrlLaunchHandler {
+ public:
+ ChromeUrlLaunchHandler();
+ ~ChromeUrlLaunchHandler();
+
+ HRESULT Initialize();
+
+ // If metro chrome was launched due to a URL navigation/search request then
+ // the navigation should be done when the frame window is initialized. This
+ // function is called to complete the pending navigation when we receive a
+ // notification from chrome that the frame window is initialized.
+ void PerformPendingNavigation();
+
+ void Activate(winapp::Activation::IActivatedEventArgs* args);
+
+ private:
+ // Invoked when we receive search notifications in metro chrome.
+ template<class T> void HandleSearchRequest(T* args);
+
+ HRESULT OnQuerySubmitted(
+ winapp::Search::ISearchPane* search_pane,
+ winapp::Search::ISearchPaneQuerySubmittedEventArgs* args);
+
+ string16 GetUrlFromLaunchArgs(const string16& launch_args);
+
+ // Invoked when a url is navigated from a metro app or in the metro
+ // shelf.
+ void HandleProtocolLaunch(
+ winapp::Activation::IProtocolActivatedEventArgs* args);
+
+ // Invoked when the app is launched normally
+ void HandleLaunch(winapp::Activation::ILaunchActivatedEventArgs* args);
+
+ // Helper function to initiate a navigation or search request in chrome.
+ void InitiateNavigationOrSearchRequest(const wchar_t* url,
+ const wchar_t* search_string);
+
+ Microsoft::WRL::ComPtr<winapp::Search::ISearchPane> search_pane_;
+ EventRegistrationToken query_submitted_token_;
+};
+
+#endif // CHROME_BROWSER_UI_METRO_DRIVER_CHROME_URL_LAUNCH_HANDLER_H_
« no previous file with comments | « win8/metro_driver/chrome_app_view.cc ('k') | win8/metro_driver/chrome_url_launch_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698