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

Unified Diff: chrome/common/instant_messages.h

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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
Index: chrome/common/instant_messages.h
diff --git a/chrome/common/instant_messages.h b/chrome/common/instant_messages.h
new file mode 100644
index 0000000000000000000000000000000000000000..e200116e2f07ed545b61375327181d9410ce16f3
--- /dev/null
+++ b/chrome/common/instant_messages.h
@@ -0,0 +1,203 @@
+// Copyright 2013 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.
+
+// Multiply-included message file, hence no traditional include guard.
+
+#include <vector>
+
+#include "base/string16.h"
+#include "chrome/common/instant_types.h"
+#include "chrome/common/omnibox_types.h"
+#include "content/public/common/page_transition_types.h"
+#include "googleurl/src/gurl.h"
+#include "ipc/ipc_message_macros.h"
+#include "ui/base/window_open_disposition.h"
+#include "ui/gfx/rect.h"
+
+#define IPC_MESSAGE_START InstantMsgStart
+
+IPC_ENUM_TRAITS(InstantCompleteBehavior)
+IPC_ENUM_TRAITS(InstantSizeUnits)
+IPC_ENUM_TRAITS(InstantSuggestionType)
+IPC_ENUM_TRAITS(OmniboxFocusState)
+IPC_ENUM_TRAITS(ThemeBackgroundImageAlignment)
+IPC_ENUM_TRAITS(ThemeBackgroundImageTiling)
+
+IPC_STRUCT_TRAITS_BEGIN(InstantAutocompleteResult)
+ IPC_STRUCT_TRAITS_MEMBER(provider)
+ IPC_STRUCT_TRAITS_MEMBER(type)
+ IPC_STRUCT_TRAITS_MEMBER(description)
+ IPC_STRUCT_TRAITS_MEMBER(destination_url)
+ IPC_STRUCT_TRAITS_MEMBER(transition)
+ IPC_STRUCT_TRAITS_MEMBER(relevance)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(InstantSuggestion)
+ IPC_STRUCT_TRAITS_MEMBER(text)
+ IPC_STRUCT_TRAITS_MEMBER(behavior)
+ IPC_STRUCT_TRAITS_MEMBER(type)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(MostVisitedItem)
+ IPC_STRUCT_TRAITS_MEMBER(url)
+ IPC_STRUCT_TRAITS_MEMBER(title)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ThemeBackgroundInfo)
+ IPC_STRUCT_TRAITS_MEMBER(color_r)
+ IPC_STRUCT_TRAITS_MEMBER(color_g)
+ IPC_STRUCT_TRAITS_MEMBER(color_b)
+ IPC_STRUCT_TRAITS_MEMBER(color_a)
+ IPC_STRUCT_TRAITS_MEMBER(theme_id)
+ IPC_STRUCT_TRAITS_MEMBER(image_horizontal_alignment)
+ IPC_STRUCT_TRAITS_MEMBER(image_vertical_alignment)
+ IPC_STRUCT_TRAITS_MEMBER(image_tiling)
+ IPC_STRUCT_TRAITS_MEMBER(image_height)
+IPC_STRUCT_TRAITS_END()
+
+// -----------------------------------------
+// Messages from the browser to the renderer
+// -----------------------------------------
+
+// Requests the renderer to determine if the page supports the searchbox API.
+// Usually sent whenever the browser notices that the page has navigated. The
+// reply is sent in ChromeViewHostMsg_SearchBoxInstantSupportDetermined. The
+// browser uses the response to decide whether to continue using the page as
+// an Instant preview.
+IPC_MESSAGE_ROUTED0(ChromeViewMsg_SearchBoxDetermineInstantSupport)
+
+// Notifies the renderer that the omnibox contents have changed. The page uses
+// this to fetch and show suggestions and/or preview results for the query.
+// If verbatim is true, the page predicts the query the user meant to type and
+// fetches results for the prediction. If verbatim is false, the query is taken
+// literally (no prediction is made).
+IPC_MESSAGE_ROUTED4(ChromeViewMsg_SearchBoxChange,
+ string16 /* query */,
+ bool /* verbatim */,
+ size_t /* selection_start */,
+ size_t /* selection_end */)
+
+// Notifies the renderer that the user hit Enter in the omnibox. The page uses
+// this to know that the user "committed" the query.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSubmit,
+ string16 /* query */)
+
+// Informs the renderer about newly available autocomplete results. The page
+// takes these into account when presenting a list of suggestions.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxAutocompleteResults,
+ std::vector<InstantAutocompleteResult> /* results */)
+
+// Requests the page to select an entry in its suggestions list, |count| items
+// away from the currently selected entry (positive to move down the list,
+// negative to move up).
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxSelect,
+ int /* count */)
+
+// Notifies the renderer that the user hit Escape after having arrowed down in
+// the suggestions list, thus cancelling the selection. The omnibox has
+// reverted to the given query. The page should reset the selection to the
+// first suggestion in its list.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxCancel,
+ string16 /* query */)
+
+// Notifies the renderer that the omnibox lost focus, because the user clicked
+// on the Instant overlay. The page uses this to know that the user implicitly
+// accepted the query by interacting with the overlay.
+// TODO(sreeram): Only used in v1 API. Remove when v1 is no longer supported.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxBlur,
+ string16 /* query */)
+
+// Notifies the renderer that the size of the omnibox popup has changed. The
+// page uses this to offset its results so that they don't overlap the popup.
+// TODO(sreeram): Only used in v1 API. Remove when v1 is no longer supported.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxPopupBounds,
+ gfx::Rect /* bounds */)
+
+// Informs the renderer about the omnibox bounds. The page uses this to align
+// its suggestions with the omnibox.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxOmniboxBounds,
+ gfx::Rect /* bounds */)
+
+// Notifies the renderer whether the omnibox is capturing key strokes (i.e.,
+// even if it appears to not have focus).
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxKeyCaptureChanged,
+ bool /* is_key_capture_enabled */)
+
+// Informs the renderer whether the user prefers to see results preview or just
+// suggestions. The page should respect this preference, but it isn't enforced.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxDisplayInstantResults,
+ bool /* display_instant_results */)
+
+// Informs the renderer about a custom theme the user has installed. The page
+// uses this to match its background to the theme.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxThemeChanged,
+ ThemeBackgroundInfo /* theme_info */)
+
+// Informs the renderer of the font and size of the omnibox text. The page uses
+// this to render its suggestions in the same font and size.
+IPC_MESSAGE_ROUTED2(ChromeViewMsg_SearchBoxFontChanged,
+ string16 /* font_name */,
+ size_t /* font_size */)
+
+// Informs the renderer about newly available most visited items. The page
+// shows these when in NTP (New Tab Page) mode.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxMostVisitedItems,
+ std::vector<MostVisitedItem> /* items */)
+
+// Informs the renderer that the page should be allowed to access and request
+// resources from the chrome-search:// scheme.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxGrantChromeSearchAccessFromOrigin,
+ GURL /* origin_url */)
+
+// -----------------------------------------
+// Messages from the renderer to the browser
+// -----------------------------------------
+
+// Informs the browser of whether the page supports the searchbox API.
+IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SearchBoxInstantSupportDetermined,
+ int /* page_id */,
+ bool /* supports_instant */)
+
+// Informs the browser of an available query completion.
+IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SearchBoxSetSuggestion,
+ int /* page_id */,
+ InstantSuggestion /* suggestion */)
+
+// Requests the browser to initiate a navigation to the given URL. This is
+// required since the page can't navigate to privileged destinations (such as
+// chrome:// URLs) or history URLs (which are hidden from the page using
+// restricted IDs) on its own.
+IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_SearchBoxNavigateToURL,
+ int /* page_id */,
+ GURL /* url */,
+ content::PageTransition /* transition */,
+ WindowOpenDisposition /* disposition */)
+
+// Requests the browser to show the page as an Instant overlay.
+IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_SearchBoxShowOverlay,
+ int /* page_id */,
+ int /* height */,
+ InstantSizeUnits /* height_units */)
+
+// Requests the omnibox to be focused visibly, invisibly or not at all.
+IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SearchBoxSetFocusState,
+ int /* page_id */,
+ OmniboxFocusState /* focus_state */)
+
+// Requests the browser to delete a URL from the most visited list. The page
+// sends this when the user clicks the "x" on a most visited item on the page.
+IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem,
+ int /* page_id */,
+ GURL /* url */)
+
+// Requests the browser to undo deletion of a URL from the most visited list.
+// The page sends this when the user changes their mind after deleting the URL
+// from the most visited list.
+IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_SearchBoxUndoMostVisitedItemDeletion,
+ int /* page_id */,
+ GURL /* url */)
+
+// Requests the browser to undo all URL deletions from the most visited list.
+IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_SearchBoxUndoAllMostVisitedItemDeletions,
+ int /* page_id */)

Powered by Google App Engine
This is Rietveld 408576698