OLD | NEW |
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 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" | 10 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // PageNavigator implementation that records the URL. | 26 // PageNavigator implementation that records the URL. |
27 class TestingPageNavigator : public PageNavigator { | 27 class TestingPageNavigator : public PageNavigator { |
28 public: | 28 public: |
29 // Deprecated. Please use the one-argument variant. | 29 // Deprecated. Please use the one-argument variant. |
30 // TODO(adriansc): Remove this method once refactoring changed all call | 30 // TODO(adriansc): Remove this method once refactoring changed all call |
31 // sites. | 31 // sites. |
32 virtual TabContents* OpenURL(const GURL& url, | 32 virtual TabContents* OpenURL(const GURL& url, |
33 const GURL& referrer, | 33 const GURL& referrer, |
34 WindowOpenDisposition disposition, | 34 WindowOpenDisposition disposition, |
35 content::PageTransition transition) OVERRIDE { | 35 content::PageTransition transition) OVERRIDE { |
36 return OpenURL(OpenURLParams(url, referrer, disposition, transition, | 36 DCHECK(referrer.is_empty()); |
37 false)); | 37 return OpenURL(OpenURLParams(url, content::Referrer(), disposition, |
| 38 transition, false)); |
38 } | 39 } |
39 | 40 |
40 virtual TabContents* OpenURL(const OpenURLParams& params) OVERRIDE { | 41 virtual TabContents* OpenURL(const OpenURLParams& params) OVERRIDE { |
41 urls_.push_back(params.url); | 42 urls_.push_back(params.url); |
42 return NULL; | 43 return NULL; |
43 } | 44 } |
44 | 45 |
45 std::vector<GURL> urls_; | 46 std::vector<GURL> urls_; |
46 }; | 47 }; |
47 | 48 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 ASSERT_EQ(bb_node->GetChild(0)->url(), bb_node->GetChild(1)->url()); | 314 ASSERT_EQ(bb_node->GetChild(0)->url(), bb_node->GetChild(1)->url()); |
314 | 315 |
315 controller.reset(new BookmarkContextMenuController( | 316 controller.reset(new BookmarkContextMenuController( |
316 NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes)); | 317 NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes)); |
317 // Cut the URL. | 318 // Cut the URL. |
318 controller->ExecuteCommand(IDC_CUT); | 319 controller->ExecuteCommand(IDC_CUT); |
319 ASSERT_TRUE(bb_node->GetChild(0)->is_url()); | 320 ASSERT_TRUE(bb_node->GetChild(0)->is_url()); |
320 ASSERT_TRUE(bb_node->GetChild(1)->is_folder()); | 321 ASSERT_TRUE(bb_node->GetChild(1)->is_folder()); |
321 ASSERT_EQ(old_count, bb_node->child_count()); | 322 ASSERT_EQ(old_count, bb_node->child_count()); |
322 } | 323 } |
OLD | NEW |