OLD | NEW |
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/ui/browser_navigator.h" | 5 #include "chrome/browser/ui/browser_navigator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/browser/browser_about_handler.h" | 10 #include "chrome/browser/browser_about_handler.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // by the time it goes out of scope, provided |params| wants it to be shown. | 227 // by the time it goes out of scope, provided |params| wants it to be shown. |
228 class ScopedBrowserDisplayer { | 228 class ScopedBrowserDisplayer { |
229 public: | 229 public: |
230 explicit ScopedBrowserDisplayer(browser::NavigateParams* params) | 230 explicit ScopedBrowserDisplayer(browser::NavigateParams* params) |
231 : params_(params) { | 231 : params_(params) { |
232 } | 232 } |
233 ~ScopedBrowserDisplayer() { | 233 ~ScopedBrowserDisplayer() { |
234 if (params_->window_action == browser::NavigateParams::SHOW_WINDOW_INACTIVE) | 234 if (params_->window_action == browser::NavigateParams::SHOW_WINDOW_INACTIVE) |
235 params_->browser->window()->ShowInactive(); | 235 params_->browser->window()->ShowInactive(); |
236 else if (params_->window_action == browser::NavigateParams::SHOW_WINDOW) | 236 else if (params_->window_action == browser::NavigateParams::SHOW_WINDOW) |
237 params_->browser->window()->Show(); | 237 params_->browser->window()->Show(BrowserWindow::SHOW_CONTEXT_NORMAL); |
238 } | 238 } |
239 private: | 239 private: |
240 browser::NavigateParams* params_; | 240 browser::NavigateParams* params_; |
241 DISALLOW_COPY_AND_ASSIGN(ScopedBrowserDisplayer); | 241 DISALLOW_COPY_AND_ASSIGN(ScopedBrowserDisplayer); |
242 }; | 242 }; |
243 | 243 |
244 // This class manages the lifetime of a TabContents created by the Navigate() | 244 // This class manages the lifetime of a TabContents created by the Navigate() |
245 // function. When Navigate() creates a TabContents for a URL, an instance of | 245 // function. When Navigate() creates a TabContents for a URL, an instance of |
246 // this class takes ownership of it via TakeOwnership() until the TabContents | 246 // this class takes ownership of it via TakeOwnership() until the TabContents |
247 // is added to a tab strip at which time ownership is relinquished via | 247 // is added to a tab strip at which time ownership is relinquished via |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 rewritten_url, replacements)) { | 522 rewritten_url, replacements)) { |
523 params->target_contents = tab; | 523 params->target_contents = tab; |
524 return tab_index; | 524 return tab_index; |
525 } | 525 } |
526 } | 526 } |
527 | 527 |
528 return -1; | 528 return -1; |
529 } | 529 } |
530 | 530 |
531 } // namespace browser | 531 } // namespace browser |
OLD | NEW |