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

Side by Side Diff: chrome/browser/bookmarks/bookmark_utils.cc

Issue 8253002: Move PageTransition into content namespace. While I'm touching all these files, I've also updated... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 #include "chrome/browser/bookmarks/bookmark_utils.h" 5 #include "chrome/browser/bookmarks/bookmark_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 browser_->window()->Show(); 68 browser_->window()->Show();
69 } 69 }
70 70
71 Browser* browser() const { return browser_; } 71 Browser* browser() const { return browser_; }
72 72
73 // Deprecated. Please use one-argument variant. 73 // Deprecated. Please use one-argument variant.
74 // TODO(adriansc): Remove this method once refactoring changed all call sites. 74 // TODO(adriansc): Remove this method once refactoring changed all call sites.
75 virtual TabContents* OpenURL(const GURL& url, 75 virtual TabContents* OpenURL(const GURL& url,
76 const GURL& referrer, 76 const GURL& referrer,
77 WindowOpenDisposition disposition, 77 WindowOpenDisposition disposition,
78 PageTransition::Type transition) OVERRIDE { 78 content::PageTransition transition) OVERRIDE {
79 return OpenURL(OpenURLParams(url, referrer, disposition, transition)); 79 return OpenURL(OpenURLParams(url, referrer, disposition, transition));
80 } 80 }
81 81
82 virtual TabContents* OpenURL(const OpenURLParams& params) OVERRIDE { 82 virtual TabContents* OpenURL(const OpenURLParams& params) OVERRIDE {
83 if (!browser_) { 83 if (!browser_) {
84 Profile* profile = (params.disposition == OFF_THE_RECORD) ? 84 Profile* profile = (params.disposition == OFF_THE_RECORD) ?
85 profile_->GetOffTheRecordProfile() : profile_; 85 profile_->GetOffTheRecordProfile() : profile_;
86 browser_ = Browser::Create(profile); 86 browser_ = Browser::Create(profile);
87 } 87 }
88 88
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 PageNavigator** navigator, 147 PageNavigator** navigator,
148 Profile* profile, 148 Profile* profile,
149 bool* opened_url) { 149 bool* opened_url) {
150 if (node->is_url()) { 150 if (node->is_url()) {
151 WindowOpenDisposition disposition; 151 WindowOpenDisposition disposition;
152 if (*opened_url) 152 if (*opened_url)
153 disposition = NEW_BACKGROUND_TAB; 153 disposition = NEW_BACKGROUND_TAB;
154 else 154 else
155 disposition = initial_disposition; 155 disposition = initial_disposition;
156 (*navigator)->OpenURL(OpenURLParams(node->url(), GURL(), disposition, 156 (*navigator)->OpenURL(OpenURLParams(node->url(), GURL(), disposition,
157 PageTransition::AUTO_BOOKMARK)); 157 content::PAGE_TRANSITION_AUTO_BOOKMARK));
158 if (!*opened_url) { 158 if (!*opened_url) {
159 *opened_url = true; 159 *opened_url = true;
160 // We opened the first URL which may have opened a new window or clobbered 160 // We opened the first URL which may have opened a new window or clobbered
161 // the current page, reset the navigator just to be sure. 161 // the current page, reset the navigator just to be sure.
162 Browser* new_browser = BrowserList::GetLastActiveWithProfile(profile); 162 Browser* new_browser = BrowserList::GetLastActiveWithProfile(profile);
163 if (new_browser) { 163 if (new_browser) {
164 TabContents* current_tab = new_browser->GetSelectedTabContents(); 164 TabContents* current_tab = new_browser->GetSelectedTabContents();
165 DCHECK(new_browser && current_tab); 165 DCHECK(new_browser && current_tab);
166 if (new_browser && current_tab) 166 if (new_browser && current_tab)
167 *navigator = current_tab; 167 *navigator = current_tab;
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 // Remove all the bookmarks. 761 // Remove all the bookmarks.
762 for (size_t i = 0; i < bookmarks.size(); ++i) { 762 for (size_t i = 0; i < bookmarks.size(); ++i) {
763 const BookmarkNode* node = bookmarks[i]; 763 const BookmarkNode* node = bookmarks[i];
764 int index = node->parent()->GetIndexOf(node); 764 int index = node->parent()->GetIndexOf(node);
765 if (index > -1) 765 if (index > -1)
766 model->Remove(node->parent(), index); 766 model->Remove(node->parent(), index);
767 } 767 }
768 } 768 }
769 769
770 } // namespace bookmark_utils 770 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model_unittest.cc ('k') | chrome/browser/browser_commands_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698