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

Side by Side Diff: chrome/renderer/render_view.h

Issue 6392045: Integrating Mac OS Grammar checker into Chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated the patch to catch up WebKit side changes. Created 9 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_RENDERER_RENDER_VIEW_H_ 5 #ifndef CHROME_RENDERER_RENDER_VIEW_H_
6 #define CHROME_RENDERER_RENDER_VIEW_H_ 6 #define CHROME_RENDERER_RENDER_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
11 #include <queue> 11 #include <queue>
12 #include <set> 12 #include <set>
13 #include <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "app/surface/transport_dib.h" 16 #include "app/surface/transport_dib.h"
17 #include "base/basictypes.h" 17 #include "base/basictypes.h"
18 #include "base/gtest_prod_util.h" 18 #include "base/gtest_prod_util.h"
19 #include "base/id_map.h"
19 #include "base/linked_ptr.h" 20 #include "base/linked_ptr.h"
20 #include "base/observer_list.h" 21 #include "base/observer_list.h"
21 #include "base/timer.h" 22 #include "base/timer.h"
22 #include "base/weak_ptr.h" 23 #include "base/weak_ptr.h"
23 #include "build/build_config.h" 24 #include "build/build_config.h"
24 #include "chrome/common/content_settings.h" 25 #include "chrome/common/content_settings.h"
25 #include "chrome/common/edit_command.h" 26 #include "chrome/common/edit_command.h"
26 #include "chrome/common/navigation_gesture.h" 27 #include "chrome/common/navigation_gesture.h"
27 #include "chrome/common/page_zoom.h" 28 #include "chrome/common/page_zoom.h"
28 #include "chrome/common/render_messages.h" 29 #include "chrome/common/render_messages.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 virtual void didChangeLoadProgress(WebKit::WebFrame* frame, 411 virtual void didChangeLoadProgress(WebKit::WebFrame* frame,
411 double load_progress); 412 double load_progress);
412 virtual bool isSmartInsertDeleteEnabled(); 413 virtual bool isSmartInsertDeleteEnabled();
413 virtual bool isSelectTrailingWhitespaceEnabled(); 414 virtual bool isSelectTrailingWhitespaceEnabled();
414 virtual void didChangeSelection(bool is_selection_empty); 415 virtual void didChangeSelection(bool is_selection_empty);
415 virtual void didExecuteCommand(const WebKit::WebString& command_name); 416 virtual void didExecuteCommand(const WebKit::WebString& command_name);
416 virtual bool handleCurrentKeyboardEvent(); 417 virtual bool handleCurrentKeyboardEvent();
417 virtual void spellCheck(const WebKit::WebString& text, 418 virtual void spellCheck(const WebKit::WebString& text,
418 int& offset, 419 int& offset,
419 int& length); 420 int& length);
421 virtual void requestCheckingOfText(
422 const WebKit::WebString& text,
423 WebKit::WebTextCheckingCompletion* completion);
420 virtual WebKit::WebString autoCorrectWord( 424 virtual WebKit::WebString autoCorrectWord(
421 const WebKit::WebString& misspelled_word); 425 const WebKit::WebString& misspelled_word);
422 virtual void showSpellingUI(bool show); 426 virtual void showSpellingUI(bool show);
423 virtual bool isShowingSpellingUI(); 427 virtual bool isShowingSpellingUI();
424 virtual void updateSpellingUIWithMisspelledWord( 428 virtual void updateSpellingUIWithMisspelledWord(
425 const WebKit::WebString& word); 429 const WebKit::WebString& word);
426 virtual void continuousSpellCheckingEnabledStateChanged(); 430 virtual void continuousSpellCheckingEnabledStateChanged();
427 virtual bool runFileChooser( 431 virtual bool runFileChooser(
428 const WebKit::WebFileChooserParams& params, 432 const WebKit::WebFileChooserParams& params,
429 WebKit::WebFileChooserCompletion* chooser_completion); 433 WebKit::WebFileChooserCompletion* chooser_completion);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 WebKit::WebSpeechInputListener* listener); 472 WebKit::WebSpeechInputListener* listener);
469 virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient(); 473 virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient();
470 virtual void zoomLimitsChanged(double minimum_level, double maximum_level); 474 virtual void zoomLimitsChanged(double minimum_level, double maximum_level);
471 virtual void zoomLevelChanged(); 475 virtual void zoomLevelChanged();
472 476
473 // WebKit::WebFrameClient implementation ------------------------------------- 477 // WebKit::WebFrameClient implementation -------------------------------------
474 478
475 virtual WebKit::WebPlugin* createPlugin( 479 virtual WebKit::WebPlugin* createPlugin(
476 WebKit::WebFrame* frame, 480 WebKit::WebFrame* frame,
477 const WebKit::WebPluginParams& params); 481 const WebKit::WebPluginParams& params);
478 virtual WebKit::WebWorker* createWorker(WebKit::WebFrame* frame, 482 virtual WebKit::WebWorker* createWorker(
479 WebKit::WebWorkerClient* client); 483 WebKit::WebFrame* frame,
484 WebKit::WebWorkerClient* client);
Hironori Bono 2011/02/09 05:43:51 nit: is this change needed by your change?
gmorrita 2011/02/10 02:15:21 Hmm. Something wrong happened. Recovered original.
480 virtual WebKit::WebSharedWorker* createSharedWorker( 485 virtual WebKit::WebSharedWorker* createSharedWorker(
481 WebKit::WebFrame* frame, const WebKit::WebURL& url, 486 WebKit::WebFrame* frame, const WebKit::WebURL& url,
482 const WebKit::WebString& name, unsigned long long documentId); 487 const WebKit::WebString& name, unsigned long long documentId);
483 virtual WebKit::WebMediaPlayer* createMediaPlayer( 488 virtual WebKit::WebMediaPlayer* createMediaPlayer(
484 WebKit::WebFrame* frame, 489 WebKit::WebFrame* frame,
485 WebKit::WebMediaPlayerClient* client); 490 WebKit::WebMediaPlayerClient* client);
486 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost( 491 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
487 WebKit::WebFrame* frame, 492 WebKit::WebFrame* frame,
488 WebKit::WebApplicationCacheHostClient* client); 493 WebKit::WebApplicationCacheHostClient* client);
489 virtual WebKit::WebCookieJar* cookieJar(WebKit::WebFrame* frame); 494 virtual WebKit::WebCookieJar* cookieJar(WebKit::WebFrame* frame);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnHandleKeyboardEvent); 692 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnHandleKeyboardEvent);
688 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, InsertCharacters); 693 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, InsertCharacters);
689 #if defined(OS_MACOSX) 694 #if defined(OS_MACOSX)
690 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp); 695 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp);
691 #endif 696 #endif
692 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, JSBlockSentAfterPageLoad); 697 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, JSBlockSentAfterPageLoad);
693 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, UpdateTargetURLWithInvalidURL); 698 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, UpdateTargetURLWithInvalidURL);
694 699
695 typedef std::map<GURL, ContentSettings> HostContentSettings; 700 typedef std::map<GURL, ContentSettings> HostContentSettings;
696 typedef std::map<GURL, double> HostZoomLevels; 701 typedef std::map<GURL, double> HostZoomLevels;
702 typedef IDMap<WebKit::WebTextCheckingCompletion> TextCheckCompletions;
697 703
698 // Cannot use std::set unfortunately since linked_ptr<> does not support 704 // Cannot use std::set unfortunately since linked_ptr<> does not support
699 // operator<. 705 // operator<.
700 typedef std::vector<linked_ptr<webkit_glue::ImageResourceFetcher> > 706 typedef std::vector<linked_ptr<webkit_glue::ImageResourceFetcher> >
701 ImageResourceFetcherList; 707 ImageResourceFetcherList;
702 708
703 // Identifies an accessibility notification from webkit. 709 // Identifies an accessibility notification from webkit.
704 struct RendererAccessibilityNotification { 710 struct RendererAccessibilityNotification {
705 public: 711 public:
706 bool ShouldIncludeChildren(); 712 bool ShouldIncludeChildren();
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 void OnSetWindowVisibility(bool visible); 934 void OnSetWindowVisibility(bool visible);
929 #endif 935 #endif
930 void OnSetZoomLevel(double zoom_level); 936 void OnSetZoomLevel(double zoom_level);
931 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); 937 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level);
932 void OnShouldClose(); 938 void OnShouldClose();
933 void OnStop(); 939 void OnStop();
934 void OnStopFinding(const ViewMsg_StopFinding_Params& params); 940 void OnStopFinding(const ViewMsg_StopFinding_Params& params);
935 void OnThemeChanged(); 941 void OnThemeChanged();
936 void OnToggleSpellCheck(); 942 void OnToggleSpellCheck();
937 void OnToggleSpellPanel(bool is_currently_visible); 943 void OnToggleSpellPanel(bool is_currently_visible);
944 void OnRespondTextCheck(int identifier, int tag,
945 const TextCheckingResultList& results);
946 void OnTranslatePage(int page_id,
Hironori Bono 2011/02/09 05:43:51 nit: is this function needed by your change?
gmorrita 2011/02/10 02:15:21 No... thank you for pointing this out. Removed. So
947 const std::string& translate_script,
948 const std::string& source_lang,
949 const std::string& target_lang);
950
938 void OnUndo(); 951 void OnUndo();
939 void OnUpdateBrowserWindowId(int window_id); 952 void OnUpdateBrowserWindowId(int window_id);
940 void OnUpdateTargetURLAck(); 953 void OnUpdateTargetURLAck();
941 void OnUpdateWebPreferences(const WebPreferences& prefs); 954 void OnUpdateWebPreferences(const WebPreferences& prefs);
942 #if defined(OS_MACOSX) 955 #if defined(OS_MACOSX)
943 void OnWindowFrameChanged(const gfx::Rect& window_frame, 956 void OnWindowFrameChanged(const gfx::Rect& window_frame,
944 const gfx::Rect& view_frame); 957 const gfx::Rect& view_frame);
945 void OnSelectPopupMenuItem(int selected_index); 958 void OnSelectPopupMenuItem(int selected_index);
946 #endif 959 #endif
947 void OnZoom(PageZoom::Function function); 960 void OnZoom(PageZoom::Function function);
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 // The node that the context menu was pressed over. 1461 // The node that the context menu was pressed over.
1449 WebKit::WebNode context_menu_node_; 1462 WebKit::WebNode context_menu_node_;
1450 1463
1451 // Reports load progress to the browser. 1464 // Reports load progress to the browser.
1452 scoped_ptr<LoadProgressTracker> load_progress_tracker_; 1465 scoped_ptr<LoadProgressTracker> load_progress_tracker_;
1453 1466
1454 // All the registered observers. We expect this list to be small, so vector 1467 // All the registered observers. We expect this list to be small, so vector
1455 // is fine. 1468 // is fine.
1456 ObserverList<RenderViewObserver> observers_; 1469 ObserverList<RenderViewObserver> observers_;
1457 1470
1471 // Holding ongoing spellchecking operations, assigning IDs
Hironori Bono 2011/02/09 05:43:51 nit: "holding" -> "holds", "assigning" -> "assigns
gmorrita 2011/02/10 02:15:21 Thanks for the clarification. Fixed.
1472 // for the IPC routing.
1473 TextCheckCompletions text_check_completions_;
1474
1458 // --------------------------------------------------------------------------- 1475 // ---------------------------------------------------------------------------
1459 // ADDING NEW DATA? Please see if it fits appropriately in one of the above 1476 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
1460 // sections rather than throwing it randomly at the end. If you're adding a 1477 // sections rather than throwing it randomly at the end. If you're adding a
1461 // bunch of stuff, you should probably create a helper class and put your 1478 // bunch of stuff, you should probably create a helper class and put your
1462 // data and methods on that to avoid bloating RenderView more. You can use 1479 // data and methods on that to avoid bloating RenderView more. You can use
1463 // the Observer interface to filter IPC messages and receive frame change 1480 // the Observer interface to filter IPC messages and receive frame change
1464 // notifications. 1481 // notifications.
1465 // --------------------------------------------------------------------------- 1482 // ---------------------------------------------------------------------------
1466 1483
1467 DISALLOW_COPY_AND_ASSIGN(RenderView); 1484 DISALLOW_COPY_AND_ASSIGN(RenderView);
1468 }; 1485 };
1469 1486
1470 #endif // CHROME_RENDERER_RENDER_VIEW_H_ 1487 #endif // CHROME_RENDERER_RENDER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698