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

Side by Side Diff: chrome/browser/extensions/extension_tab_util.cc

Issue 1211003006: [Extensions OOPI] Update app window bindings for OOPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/options_handlers_helper.cc » ('j') | 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/extensions/extension_tab_util.h" 5 #include "chrome/browser/extensions/extension_tab_util.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" 9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
10 #include "chrome/browser/extensions/chrome_extension_function.h" 10 #include "chrome/browser/extensions/chrome_extension_function.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 namespace { 49 namespace {
50 50
51 namespace keys = tabs_constants; 51 namespace keys = tabs_constants;
52 52
53 WindowController* GetAppWindowController(const WebContents* contents) { 53 WindowController* GetAppWindowController(const WebContents* contents) {
54 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 54 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
55 AppWindowRegistry* registry = AppWindowRegistry::Get(profile); 55 AppWindowRegistry* registry = AppWindowRegistry::Get(profile);
56 if (!registry) 56 if (!registry)
57 return NULL; 57 return NULL;
58 AppWindow* app_window = 58 AppWindow* app_window = registry->GetAppWindowForWebContents(contents);
59 registry->GetAppWindowForRenderViewHost(contents->GetRenderViewHost());
60 if (!app_window) 59 if (!app_window)
61 return NULL; 60 return NULL;
62 return WindowControllerList::GetInstance()->FindWindowById( 61 return WindowControllerList::GetInstance()->FindWindowById(
63 app_window->session_id().id()); 62 app_window->session_id().id());
64 } 63 }
65 64
66 // |error_message| can optionally be passed in and will be set with an 65 // |error_message| can optionally be passed in and will be set with an
67 // appropriate message if the window cannot be found by id. 66 // appropriate message if the window cannot be found by id.
68 Browser* GetBrowserInProfileWithId(Profile* profile, 67 Browser* GetBrowserInProfileWithId(Profile* profile,
69 const int window_id, 68 const int window_id,
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 610
612 chrome::NavigateParams params( 611 chrome::NavigateParams params(
613 chrome::GetSingletonTabNavigateParams(browser, url_to_navigate)); 612 chrome::GetSingletonTabNavigateParams(browser, url_to_navigate));
614 params.path_behavior = chrome::NavigateParams::IGNORE_AND_NAVIGATE; 613 params.path_behavior = chrome::NavigateParams::IGNORE_AND_NAVIGATE;
615 params.url = url_to_navigate; 614 params.url = url_to_navigate;
616 chrome::ShowSingletonTabOverwritingNTP(browser, params); 615 chrome::ShowSingletonTabOverwritingNTP(browser, params);
617 return true; 616 return true;
618 } 617 }
619 618
620 } // namespace extensions 619 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/options_handlers_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698