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

Unified Diff: chrome/browser/ui/views/frame/browser_frame_win.cc

Issue 10824387: Implement forwarding of search queries for metro mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/startup/startup_browser_creator_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_frame_win.cc
===================================================================
--- chrome/browser/ui/views/frame/browser_frame_win.cc (revision 151723)
+++ chrome/browser/ui/views/frame/browser_frame_win.cc (working copy)
@@ -489,11 +489,6 @@
void BrowserFrameWin::HandleMetroNavSearchRequest(WPARAM w_param,
LPARAM l_param) {
- if (!base::win::IsMetroProcess()) {
- NOTREACHED() << "Received unexpected metro navigation request";
- return;
- }
-
if (!w_param && !l_param) {
NOTREACHED() << "Invalid metro request parameters";
return;
@@ -505,11 +500,27 @@
GURL request_url;
if (w_param) {
+ // Navigation request.
const wchar_t* url = reinterpret_cast<const wchar_t*>(w_param);
request_url = GURL(url);
} else if (l_param) {
- const wchar_t* search_string =
- reinterpret_cast<const wchar_t*>(l_param);
+ // Search request.
+ const wchar_t* search_string;
+ wchar_t atom[128] = {0};
ananta 2012/08/20 21:40:48 Instead of hardcoding the atom array size, perhaps
+ if (!base::win::IsMetroProcess()) {
+ // Normally, we only receive this message from our own process if we are
+ // in metro. If we are not, then it means that metro chrome is sending
+ // us that message and the url is in an atom.
+ UINT result =
+ GlobalGetAtomName(static_cast<ATOM>(l_param), atom, arraysize(atom));
+ if (!result)
+ return;
+ search_string = atom;
+ GlobalDeleteAtom(static_cast<ATOM>(l_param));
+ } else {
+ search_string = reinterpret_cast<const wchar_t*>(l_param);
+ }
+
const TemplateURL* default_provider =
TemplateURLServiceFactory::GetForProfile(browser->profile())->
GetDefaultSearchProvider();
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698