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

Side by Side Diff: chrome/browser/ui/panels/panel_host.cc

Issue 10824358: [Panels] Remove use of banned FindOrCreateTabbedBrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/ui/panels/panel_host.h" 5 #include "chrome/browser/ui/panels/panel_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/chrome_page_zoom.h" 10 #include "chrome/browser/chrome_page_zoom.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (params.disposition == SUPPRESS_OPEN || 81 if (params.disposition == SUPPRESS_OPEN ||
82 params.disposition == SAVE_TO_DISK || 82 params.disposition == SAVE_TO_DISK ||
83 params.disposition == IGNORE_ACTION) 83 params.disposition == IGNORE_ACTION)
84 return NULL; 84 return NULL;
85 85
86 // Only allow clicks on links. 86 // Only allow clicks on links.
87 if (params.transition != content::PAGE_TRANSITION_LINK) 87 if (params.transition != content::PAGE_TRANSITION_LINK)
88 return NULL; 88 return NULL;
89 89
90 // Force all links to open in a new tab. 90 // Force all links to open in a new tab.
91 chrome::NavigateParams navigate_params( 91 chrome::NavigateParams navigate_params(profile_,
92 browser::FindOrCreateTabbedBrowser(profile_), 92 params.url,
93 params.url, params.transition); 93 params.transition);
94 navigate_params.disposition = params.disposition == NEW_BACKGROUND_TAB ? 94 navigate_params.disposition = params.disposition == NEW_BACKGROUND_TAB ?
95 params.disposition : NEW_FOREGROUND_TAB; 95 params.disposition : NEW_FOREGROUND_TAB;
96 chrome::Navigate(&navigate_params); 96 chrome::Navigate(&navigate_params);
97 return navigate_params.target_contents ? 97 return navigate_params.target_contents ?
98 navigate_params.target_contents->web_contents() : NULL; 98 navigate_params.target_contents->web_contents() : NULL;
99 } 99 }
100 100
101 void PanelHost::NavigationStateChanged(const content::WebContents* source, 101 void PanelHost::NavigationStateChanged(const content::WebContents* source,
102 unsigned changed_flags) { 102 unsigned changed_flags) {
103 // Only need to update the title if the title changed while not loading, 103 // Only need to update the title if the title changed while not loading,
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 215
216 void PanelHost::StopLoading() { 216 void PanelHost::StopLoading() {
217 content::RecordAction(UserMetricsAction("Stop")); 217 content::RecordAction(UserMetricsAction("Stop"));
218 web_contents_->Stop(); 218 web_contents_->Stop();
219 } 219 }
220 220
221 void PanelHost::Zoom(content::PageZoom zoom) { 221 void PanelHost::Zoom(content::PageZoom zoom) {
222 chrome_page_zoom::Zoom(web_contents_.get(), zoom); 222 chrome_page_zoom::Zoom(web_contents_.get(), zoom);
223 } 223 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698