OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/settings_window_manager.h" | 5 #include "chrome/browser/ui/settings_window_manager.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 Browser* browser = FindBrowserForProfile(profile); | 39 Browser* browser = FindBrowserForProfile(profile); |
40 if (browser) { | 40 if (browser) { |
41 DCHECK(browser->profile() == profile); | 41 DCHECK(browser->profile() == profile); |
42 const content::WebContents* web_contents = | 42 const content::WebContents* web_contents = |
43 browser->tab_strip_model()->GetWebContentsAt(0); | 43 browser->tab_strip_model()->GetWebContentsAt(0); |
44 if (web_contents && web_contents->GetURL() == gurl) { | 44 if (web_contents && web_contents->GetURL() == gurl) { |
45 browser->window()->Show(); | 45 browser->window()->Show(); |
46 return; | 46 return; |
47 } | 47 } |
48 NavigateParams params(browser, gurl, | 48 NavigateParams params(browser, gurl, |
49 content::PAGE_TRANSITION_AUTO_BOOKMARK); | 49 ui::PAGE_TRANSITION_AUTO_BOOKMARK); |
50 params.window_action = NavigateParams::SHOW_WINDOW; | 50 params.window_action = NavigateParams::SHOW_WINDOW; |
51 params.user_gesture = true; | 51 params.user_gesture = true; |
52 chrome::Navigate(¶ms); | 52 chrome::Navigate(¶ms); |
53 return; | 53 return; |
54 } | 54 } |
55 | 55 |
56 // No existing browser window, create one. | 56 // No existing browser window, create one. |
57 NavigateParams params(profile, gurl, content::PAGE_TRANSITION_AUTO_BOOKMARK); | 57 NavigateParams params(profile, gurl, ui::PAGE_TRANSITION_AUTO_BOOKMARK); |
58 params.disposition = NEW_POPUP; | 58 params.disposition = NEW_POPUP; |
59 params.trusted_source = true; | 59 params.trusted_source = true; |
60 params.window_action = NavigateParams::SHOW_WINDOW; | 60 params.window_action = NavigateParams::SHOW_WINDOW; |
61 params.user_gesture = true; | 61 params.user_gesture = true; |
62 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; | 62 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; |
63 chrome::Navigate(¶ms); | 63 chrome::Navigate(¶ms); |
64 settings_session_map_[profile] = params.browser->session_id().id(); | 64 settings_session_map_[profile] = params.browser->session_id().id(); |
65 | 65 |
66 FOR_EACH_OBSERVER(SettingsWindowManagerObserver, | 66 FOR_EACH_OBSERVER(SettingsWindowManagerObserver, |
67 observers_, OnNewSettingsWindow(params.browser)); | 67 observers_, OnNewSettingsWindow(params.browser)); |
(...skipping 13 matching lines...) Expand all Loading... |
81 iter->second == browser->session_id().id()); | 81 iter->second == browser->session_id().id()); |
82 } | 82 } |
83 | 83 |
84 SettingsWindowManager::SettingsWindowManager() { | 84 SettingsWindowManager::SettingsWindowManager() { |
85 } | 85 } |
86 | 86 |
87 SettingsWindowManager::~SettingsWindowManager() { | 87 SettingsWindowManager::~SettingsWindowManager() { |
88 } | 88 } |
89 | 89 |
90 } // namespace chrome | 90 } // namespace chrome |
OLD | NEW |