OLD | NEW |
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 | 5 |
6 #include <algorithm> | 6 #include <algorithm> |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 class NavEntryCommittedObserver : public content::NotificationObserver { | 66 class NavEntryCommittedObserver : public content::NotificationObserver { |
67 public: | 67 public: |
68 explicit NavEntryCommittedObserver(WebContents* web_contents) { | 68 explicit NavEntryCommittedObserver(WebContents* web_contents) { |
69 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 69 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
70 content::Source<NavigationController>( | 70 content::Source<NavigationController>( |
71 &web_contents->GetController())); | 71 &web_contents->GetController())); |
72 } | 72 } |
73 | 73 |
74 virtual void Observe(int type, | 74 virtual void Observe(int type, |
75 const content::NotificationSource& source, | 75 const content::NotificationSource& source, |
76 const content::NotificationDetails& details) { | 76 const content::NotificationDetails& details) OVERRIDE { |
77 DCHECK(type == content::NOTIFICATION_NAV_ENTRY_COMMITTED); | 77 DCHECK(type == content::NOTIFICATION_NAV_ENTRY_COMMITTED); |
78 details_ = | 78 details_ = |
79 *(content::Details<content::LoadCommittedDetails>(details).ptr()); | 79 *(content::Details<content::LoadCommittedDetails>(details).ptr()); |
80 } | 80 } |
81 | 81 |
82 const content::LoadCommittedDetails& | 82 const content::LoadCommittedDetails& |
83 get_load_commited_details() const { | 83 get_load_commited_details() const { |
84 return details_; | 84 return details_; |
85 } | 85 } |
86 | 86 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 params.writing_direction_right_to_left = 0; | 335 params.writing_direction_right_to_left = 0; |
336 #endif // OS_MACOSX | 336 #endif // OS_MACOSX |
337 params.edit_flags = WebContextMenuData::CanTranslate; | 337 params.edit_flags = WebContextMenuData::CanTranslate; |
338 return new TestRenderViewContextMenu(web_contents, params); | 338 return new TestRenderViewContextMenu(web_contents, params); |
339 } | 339 } |
340 | 340 |
341 bool IsItemPresent(int id) { | 341 bool IsItemPresent(int id) { |
342 return menu_model_.GetIndexOfCommandId(id) != -1; | 342 return menu_model_.GetIndexOfCommandId(id) != -1; |
343 } | 343 } |
344 | 344 |
345 virtual void PlatformInit() { } | 345 virtual void PlatformInit() OVERRIDE { } |
346 virtual void PlatformCancel() { } | 346 virtual void PlatformCancel() OVERRIDE { } |
347 virtual bool GetAcceleratorForCommandId( | 347 virtual bool GetAcceleratorForCommandId( |
348 int command_id, | 348 int command_id, |
349 ui::Accelerator* accelerator) { return false; } | 349 ui::Accelerator* accelerator) OVERRIDE { return false; } |
350 | 350 |
351 private: | 351 private: |
352 TestRenderViewContextMenu(WebContents* web_contents, | 352 TestRenderViewContextMenu(WebContents* web_contents, |
353 const content::ContextMenuParams& params) | 353 const content::ContextMenuParams& params) |
354 : RenderViewContextMenu(web_contents, params) { | 354 : RenderViewContextMenu(web_contents, params) { |
355 } | 355 } |
356 | 356 |
357 DISALLOW_COPY_AND_ASSIGN(TestRenderViewContextMenu); | 357 DISALLOW_COPY_AND_ASSIGN(TestRenderViewContextMenu); |
358 }; | 358 }; |
359 | 359 |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1540 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, MAYBE_TranslateSessionRestore) { | 1540 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, MAYBE_TranslateSessionRestore) { |
1541 WebContents* current_web_contents = | 1541 WebContents* current_web_contents = |
1542 browser()->tab_strip_model()->GetActiveWebContents(); | 1542 browser()->tab_strip_model()->GetActiveWebContents(); |
1543 content::Source<WebContents> source(current_web_contents); | 1543 content::Source<WebContents> source(current_web_contents); |
1544 | 1544 |
1545 ui_test_utils::WindowedNotificationObserverWithDetails<std::string> | 1545 ui_test_utils::WindowedNotificationObserverWithDetails<std::string> |
1546 fr_language_detected_signal(chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, | 1546 fr_language_detected_signal(chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, |
1547 source); | 1547 source); |
1548 fr_language_detected_signal.Wait(); | 1548 fr_language_detected_signal.Wait(); |
1549 } | 1549 } |
OLD | NEW |