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

Side by Side Diff: chrome/browser/ui/apps/chrome_app_window_delegate.cc

Issue 187653006: Activate browser window when opening new tab from a packaged app window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/apps/chrome_app_window_delegate.h" 5 #include "chrome/browser/ui/apps/chrome_app_window_delegate.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/favicon/favicon_tab_helper.h" 8 #include "chrome/browser/favicon/favicon_tab_helper.h"
9 #include "chrome/browser/file_select_helper.h" 9 #include "chrome/browser/file_select_helper.h"
10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 10 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
(...skipping 30 matching lines...) Expand all
41 41
42 // Opens a URL with Chromium (not external browser) with the right profile. 42 // Opens a URL with Chromium (not external browser) with the right profile.
43 content::WebContents* OpenURLFromTabInternal( 43 content::WebContents* OpenURLFromTabInternal(
44 content::BrowserContext* context, 44 content::BrowserContext* context,
45 content::WebContents* source, 45 content::WebContents* source,
46 const content::OpenURLParams& params) { 46 const content::OpenURLParams& params) {
47 // Force all links to open in a new tab, even if they were trying to open a 47 // Force all links to open in a new tab, even if they were trying to open a
48 // window. 48 // window.
49 chrome::NavigateParams new_tab_params( 49 chrome::NavigateParams new_tab_params(
50 static_cast<Browser*>(NULL), params.url, params.transition); 50 static_cast<Browser*>(NULL), params.url, params.transition);
51 new_tab_params.disposition = params.disposition == NEW_BACKGROUND_TAB 51 if (params.disposition == NEW_BACKGROUND_TAB) {
52 ? params.disposition 52 new_tab_params.disposition = NEW_BACKGROUND_TAB;
53 : NEW_FOREGROUND_TAB; 53 } else {
54 new_tab_params.disposition = NEW_FOREGROUND_TAB;
55 new_tab_params.window_action = chrome::NavigateParams::SHOW_WINDOW;
56 }
57
54 new_tab_params.initiating_profile = Profile::FromBrowserContext(context); 58 new_tab_params.initiating_profile = Profile::FromBrowserContext(context);
55 chrome::Navigate(&new_tab_params); 59 chrome::Navigate(&new_tab_params);
56 60
57 return new_tab_params.target_contents; 61 return new_tab_params.target_contents;
58 } 62 }
59 63
60 // Helper class that opens a URL based on if this browser instance is the 64 // Helper class that opens a URL based on if this browser instance is the
61 // default system browser. If it is the default, open the URL directly instead 65 // default system browser. If it is the default, open the URL directly instead
62 // of asking the system to open it. 66 // of asking the system to open it.
63 class OpenURLFromTabBasedOnBrowserDefault 67 class OpenURLFromTabBasedOnBrowserDefault
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 if (host) { 219 if (host) {
216 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized( 220 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized(
217 host->GetRoutingID(), blocked)); 221 host->GetRoutingID(), blocked));
218 } 222 }
219 } 223 }
220 224
221 bool ChromeAppWindowDelegate::IsWebContentsVisible( 225 bool ChromeAppWindowDelegate::IsWebContentsVisible(
222 content::WebContents* web_contents) { 226 content::WebContents* web_contents) {
223 return platform_util::IsVisible(web_contents->GetView()->GetNativeView()); 227 return platform_util::IsVisible(web_contents->GetView()->GetNativeView());
224 } 228 }
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