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

Side by Side Diff: chrome/common/render_messages.h

Issue 219963007: Move Translate renderer messages to the Translate component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Multiply-included file, no traditional include guard. 5 // Multiply-included file, no traditional include guard.
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/memory/shared_memory.h" 13 #include "base/memory/shared_memory.h"
14 #include "base/process/process.h" 14 #include "base/process/process.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "build/build_config.h" 18 #include "build/build_config.h"
19 #include "chrome/common/autocomplete_match_type.h" 19 #include "chrome/common/autocomplete_match_type.h"
20 #include "chrome/common/common_param_traits.h" 20 #include "chrome/common/common_param_traits.h"
21 #include "chrome/common/content_settings.h" 21 #include "chrome/common/content_settings.h"
22 #include "chrome/common/content_settings_pattern.h" 22 #include "chrome/common/content_settings_pattern.h"
23 #include "chrome/common/instant_types.h" 23 #include "chrome/common/instant_types.h"
24 #include "chrome/common/ntp_logging_events.h" 24 #include "chrome/common/ntp_logging_events.h"
25 #include "chrome/common/omnibox_focus_state.h" 25 #include "chrome/common/omnibox_focus_state.h"
26 #include "chrome/common/search_provider.h" 26 #include "chrome/common/search_provider.h"
27 #include "components/nacl/common/nacl_types.h" 27 #include "components/nacl/common/nacl_types.h"
28 #include "components/translate/core/common/language_detection_details.h"
29 #include "components/translate/core/common/translate_errors.h"
30 #include "content/public/common/common_param_traits.h" 28 #include "content/public/common/common_param_traits.h"
31 #include "content/public/common/referrer.h" 29 #include "content/public/common/referrer.h"
32 #include "content/public/common/top_controls_state.h" 30 #include "content/public/common/top_controls_state.h"
33 #include "extensions/common/stack_frame.h" 31 #include "extensions/common/stack_frame.h"
34 #include "ipc/ipc_channel_handle.h" 32 #include "ipc/ipc_channel_handle.h"
35 #include "ipc/ipc_message_macros.h" 33 #include "ipc/ipc_message_macros.h"
36 #include "ipc/ipc_platform_file.h" 34 #include "ipc/ipc_platform_file.h"
37 #include "third_party/skia/include/core/SkBitmap.h" 35 #include "third_party/skia/include/core/SkBitmap.h"
38 #include "third_party/WebKit/public/web/WebCache.h" 36 #include "third_party/WebKit/public/web/WebCache.h"
39 #include "third_party/WebKit/public/web/WebConsoleMessage.h" 37 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 #define IPC_MESSAGE_START ChromeMsgStart 120 #define IPC_MESSAGE_START ChromeMsgStart
123 121
124 IPC_ENUM_TRAITS_MAX_VALUE(ChromeViewHostMsg_GetPluginInfo_Status::Value, 122 IPC_ENUM_TRAITS_MAX_VALUE(ChromeViewHostMsg_GetPluginInfo_Status::Value,
125 ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized) 123 ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized)
126 IPC_ENUM_TRAITS(OmniboxFocusChangeReason) 124 IPC_ENUM_TRAITS(OmniboxFocusChangeReason)
127 IPC_ENUM_TRAITS(OmniboxFocusState) 125 IPC_ENUM_TRAITS(OmniboxFocusState)
128 IPC_ENUM_TRAITS(search_provider::OSDDType) 126 IPC_ENUM_TRAITS(search_provider::OSDDType)
129 IPC_ENUM_TRAITS(search_provider::InstallState) 127 IPC_ENUM_TRAITS(search_provider::InstallState)
130 IPC_ENUM_TRAITS(ThemeBackgroundImageAlignment) 128 IPC_ENUM_TRAITS(ThemeBackgroundImageAlignment)
131 IPC_ENUM_TRAITS(ThemeBackgroundImageTiling) 129 IPC_ENUM_TRAITS(ThemeBackgroundImageTiling)
132 IPC_ENUM_TRAITS(TranslateErrors::Type)
133 IPC_ENUM_TRAITS(blink::WebConsoleMessage::Level) 130 IPC_ENUM_TRAITS(blink::WebConsoleMessage::Level)
134 IPC_ENUM_TRAITS(content::TopControlsState) 131 IPC_ENUM_TRAITS(content::TopControlsState)
135 132
136 IPC_STRUCT_TRAITS_BEGIN(ChromeViewHostMsg_GetPluginInfo_Status) 133 IPC_STRUCT_TRAITS_BEGIN(ChromeViewHostMsg_GetPluginInfo_Status)
137 IPC_STRUCT_TRAITS_MEMBER(value) 134 IPC_STRUCT_TRAITS_MEMBER(value)
138 IPC_STRUCT_TRAITS_END() 135 IPC_STRUCT_TRAITS_END()
139 136
140 // Output parameters for ChromeViewHostMsg_GetPluginInfo message. 137 // Output parameters for ChromeViewHostMsg_GetPluginInfo message.
141 IPC_STRUCT_BEGIN(ChromeViewHostMsg_GetPluginInfo_Output) 138 IPC_STRUCT_BEGIN(ChromeViewHostMsg_GetPluginInfo_Output)
142 IPC_STRUCT_MEMBER(ChromeViewHostMsg_GetPluginInfo_Status, status) 139 IPC_STRUCT_MEMBER(ChromeViewHostMsg_GetPluginInfo_Status, status)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 IPC_STRUCT_TRAITS_END() 217 IPC_STRUCT_TRAITS_END()
221 218
222 IPC_STRUCT_TRAITS_BEGIN(blink::WebCache::UsageStats) 219 IPC_STRUCT_TRAITS_BEGIN(blink::WebCache::UsageStats)
223 IPC_STRUCT_TRAITS_MEMBER(minDeadCapacity) 220 IPC_STRUCT_TRAITS_MEMBER(minDeadCapacity)
224 IPC_STRUCT_TRAITS_MEMBER(maxDeadCapacity) 221 IPC_STRUCT_TRAITS_MEMBER(maxDeadCapacity)
225 IPC_STRUCT_TRAITS_MEMBER(capacity) 222 IPC_STRUCT_TRAITS_MEMBER(capacity)
226 IPC_STRUCT_TRAITS_MEMBER(liveSize) 223 IPC_STRUCT_TRAITS_MEMBER(liveSize)
227 IPC_STRUCT_TRAITS_MEMBER(deadSize) 224 IPC_STRUCT_TRAITS_MEMBER(deadSize)
228 IPC_STRUCT_TRAITS_END() 225 IPC_STRUCT_TRAITS_END()
229 226
230 IPC_STRUCT_TRAITS_BEGIN(LanguageDetectionDetails)
231 IPC_STRUCT_TRAITS_MEMBER(time)
232 IPC_STRUCT_TRAITS_MEMBER(url)
233 IPC_STRUCT_TRAITS_MEMBER(content_language)
234 IPC_STRUCT_TRAITS_MEMBER(cld_language)
235 IPC_STRUCT_TRAITS_MEMBER(is_cld_reliable)
236 IPC_STRUCT_TRAITS_MEMBER(html_root_language)
237 IPC_STRUCT_TRAITS_MEMBER(adopted_language)
238 IPC_STRUCT_TRAITS_MEMBER(contents)
239 IPC_STRUCT_TRAITS_END()
240
241 IPC_STRUCT_TRAITS_BEGIN(extensions::StackFrame) 227 IPC_STRUCT_TRAITS_BEGIN(extensions::StackFrame)
242 IPC_STRUCT_TRAITS_MEMBER(line_number) 228 IPC_STRUCT_TRAITS_MEMBER(line_number)
243 IPC_STRUCT_TRAITS_MEMBER(column_number) 229 IPC_STRUCT_TRAITS_MEMBER(column_number)
244 IPC_STRUCT_TRAITS_MEMBER(source) 230 IPC_STRUCT_TRAITS_MEMBER(source)
245 IPC_STRUCT_TRAITS_MEMBER(function) 231 IPC_STRUCT_TRAITS_MEMBER(function)
246 IPC_STRUCT_TRAITS_END() 232 IPC_STRUCT_TRAITS_END()
247 233
248 IPC_ENUM_TRAITS_MAX_VALUE(NTPLoggingEventType, 234 IPC_ENUM_TRAITS_MAX_VALUE(NTPLoggingEventType,
249 NTP_NUM_EVENT_TYPES) 235 NTP_NUM_EVENT_TYPES)
250 236
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 base::string16 /* identity */, 308 base::string16 /* identity */,
323 bool /* identity_match */) 309 bool /* identity_match */)
324 310
325 IPC_MESSAGE_ROUTED0(ChromeViewMsg_SearchBoxToggleVoiceSearch) 311 IPC_MESSAGE_ROUTED0(ChromeViewMsg_SearchBoxToggleVoiceSearch)
326 312
327 // Toggles visual muting of the render view area. This is on when a constrained 313 // Toggles visual muting of the render view area. This is on when a constrained
328 // window is showing. 314 // window is showing.
329 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetVisuallyDeemphasized, 315 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetVisuallyDeemphasized,
330 bool /* deemphazied */) 316 bool /* deemphazied */)
331 317
332 // Tells the renderer to translate the page contents from one language to
333 // another.
334 IPC_MESSAGE_ROUTED4(ChromeViewMsg_TranslatePage,
335 int /* page id */,
336 std::string, /* the script injected in the page */
337 std::string, /* BCP 47/RFC 5646 language code the page
338 is in */
339 std::string /* BCP 47/RFC 5646 language code to translate
340 to */)
341
342 // Tells the renderer to revert the text of translated page to its original
343 // contents.
344 IPC_MESSAGE_ROUTED1(ChromeViewMsg_RevertTranslation,
345 int /* page id */)
346
347 // Sent on process startup to indicate whether this process is running in 318 // Sent on process startup to indicate whether this process is running in
348 // incognito mode. 319 // incognito mode.
349 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetIsIncognitoProcess, 320 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetIsIncognitoProcess,
350 bool /* is_incognito_processs */) 321 bool /* is_incognito_processs */)
351 322
352 // Sent in response to ViewHostMsg_DidBlockDisplayingInsecureContent. 323 // Sent in response to ViewHostMsg_DidBlockDisplayingInsecureContent.
353 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowDisplayingInsecureContent, 324 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowDisplayingInsecureContent,
354 bool /* allowed */) 325 bool /* allowed */)
355 326
356 // Sent in response to ViewHostMsg_DidBlockRunningInsecureContent. 327 // Sent in response to ViewHostMsg_DidBlockRunningInsecureContent.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 // be treated as a webapp. 365 // be treated as a webapp.
395 IPC_MESSAGE_ROUTED1(ChromeViewMsg_RetrieveWebappInformation, 366 IPC_MESSAGE_ROUTED1(ChromeViewMsg_RetrieveWebappInformation,
396 GURL /* expected_url */) 367 GURL /* expected_url */)
397 368
398 // Asks the renderer to return information about the given meta tag. 369 // Asks the renderer to return information about the given meta tag.
399 IPC_MESSAGE_ROUTED2(ChromeViewMsg_RetrieveMetaTagContent, 370 IPC_MESSAGE_ROUTED2(ChromeViewMsg_RetrieveMetaTagContent,
400 GURL /* expected_url */, 371 GURL /* expected_url */,
401 std::string /* tag_name */ ) 372 std::string /* tag_name */ )
402 #endif // defined(OS_ANDROID) 373 #endif // defined(OS_ANDROID)
403 374
404 #if defined(CLD2_DYNAMIC_MODE)
405 // Informs the renderer process that Compact Language Detector (CLD) data is
406 // available and provides an IPC::PlatformFileForTransit obtained from
407 // IPC::GetFileHandleForProcess(...)
408 // See also: ChromeViewHostMsg_NeedCLDData
409 IPC_MESSAGE_ROUTED3(ChromeViewMsg_CLDDataAvailable,
410 IPC::PlatformFileForTransit /* ipc_file_handle */,
411 uint64 /* data_offset */,
412 uint64 /* data_length */)
413 #endif
414
415 // chrome.principals messages ------------------------------------------------ 375 // chrome.principals messages ------------------------------------------------
416 376
417 // Message sent from the renderer to the browser to get the list of browser 377 // Message sent from the renderer to the browser to get the list of browser
418 // managed accounts for the given origin. 378 // managed accounts for the given origin.
419 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_GetManagedAccounts, 379 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_GetManagedAccounts,
420 GURL /* current URL */, 380 GURL /* current URL */,
421 std::vector<std::string> /* managed accounts */) 381 std::vector<std::string> /* managed accounts */)
422 382
423 // Message sent from the renderer to the browser to show the browser account 383 // Message sent from the renderer to the browser to show the browser account
424 // management UI. 384 // management UI.
(...skipping 26 matching lines...) Expand all
451 GURL /* Navigation correction service base URL */, 411 GURL /* Navigation correction service base URL */,
452 std::string /* language */, 412 std::string /* language */,
453 std::string /* origin_country */, 413 std::string /* origin_country */,
454 std::string /* API key to use */, 414 std::string /* API key to use */,
455 GURL /* Google Search URL to use */) 415 GURL /* Google Search URL to use */)
456 416
457 //----------------------------------------------------------------------------- 417 //-----------------------------------------------------------------------------
458 // Misc messages 418 // Misc messages
459 // These are messages sent from the renderer to the browser process. 419 // These are messages sent from the renderer to the browser process.
460 420
461 // Notification that the language for the tab has been determined.
462 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_TranslateLanguageDetermined,
463 LanguageDetectionDetails /* details about lang detection */,
464 bool /* whether the page needs translation */)
465
466 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_UpdatedCacheStats, 421 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_UpdatedCacheStats,
467 blink::WebCache::UsageStats /* stats */) 422 blink::WebCache::UsageStats /* stats */)
468 423
469 // Tells the browser that content in the current page was blocked due to the 424 // Tells the browser that content in the current page was blocked due to the
470 // user's content settings. 425 // user's content settings.
471 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_ContentBlocked, 426 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_ContentBlocked,
472 ContentSettingsType /* type of blocked content */) 427 ContentSettingsType /* type of blocked content */)
473 428
474 // Sent by the renderer process to check whether access to web databases is 429 // Sent by the renderer process to check whether access to web databases is
475 // granted by content settings. 430 // granted by content settings.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 // user authorization. 578 // user authorization.
624 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_BlockedUnauthorizedPlugin, 579 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_BlockedUnauthorizedPlugin,
625 base::string16 /* name */, 580 base::string16 /* name */,
626 std::string /* plug-in group identifier */) 581 std::string /* plug-in group identifier */)
627 582
628 // Provide the browser process with information about the WebCore resource 583 // Provide the browser process with information about the WebCore resource
629 // cache and current renderer framerate. 584 // cache and current renderer framerate.
630 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_ResourceTypeStats, 585 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_ResourceTypeStats,
631 blink::WebCache::ResourceTypeStats) 586 blink::WebCache::ResourceTypeStats)
632 587
633 // Notifies the browser that a page has been translated.
634 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_PageTranslated,
635 int, /* page id */
636 std::string /* the original language */,
637 std::string /* the translated language */,
638 TranslateErrors::Type /* the error type if available */)
639
640 // Message sent from the renderer to the browser to notify it of a 588 // Message sent from the renderer to the browser to notify it of a
641 // window.print() call which should cancel the prerender. The message is sent 589 // window.print() call which should cancel the prerender. The message is sent
642 // only when the renderer is prerendering. 590 // only when the renderer is prerendering.
643 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_CancelPrerenderForPrinting) 591 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_CancelPrerenderForPrinting)
644 592
645 // Sent by the renderer to check if a URL has permission to trigger a clipboard 593 // Sent by the renderer to check if a URL has permission to trigger a clipboard
646 // read/write operation from the DOM. 594 // read/write operation from the DOM.
647 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_CanTriggerClipboardRead, 595 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_CanTriggerClipboardRead,
648 GURL /* origin */, 596 GURL /* origin */,
649 bool /* allowed */) 597 bool /* allowed */)
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 // WebKit. 730 // WebKit.
783 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DetailedConsoleMessageAdded, 731 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DetailedConsoleMessageAdded,
784 base::string16 /* message */, 732 base::string16 /* message */,
785 base::string16 /* source */, 733 base::string16 /* source */,
786 extensions::StackTrace /* stack trace */, 734 extensions::StackTrace /* stack trace */,
787 int32 /* severity level */) 735 int32 /* severity level */)
788 736
789 // Sent by the renderer to check if crash reporting is enabled. 737 // Sent by the renderer to check if crash reporting is enabled.
790 IPC_SYNC_MESSAGE_CONTROL0_1(ChromeViewHostMsg_IsCrashReportingEnabled, 738 IPC_SYNC_MESSAGE_CONTROL0_1(ChromeViewHostMsg_IsCrashReportingEnabled,
791 bool /* enabled */) 739 bool /* enabled */)
792
793 #if defined(CLD2_DYNAMIC_MODE)
794 // Informs the browser process that Compact Language Detector (CLD) data is
795 // required by the originating renderer. The browser process should respond
796 // with a ChromeViewMsg_CLDDataAvailable if the data is available, else it
797 // should go unanswered (the renderer will ask again later).
798 // See also: ChromeViewMsg_CLDDataAvailable
799 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_NeedCLDData)
800 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698