OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <numeric> | 8 #include <numeric> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 // We need to deactivate the controls (in the "WebView"). To do this, get the | 658 // We need to deactivate the controls (in the "WebView"). To do this, get the |
659 // selected WebContents's RenderWidgetHostView and tell it to deactivate. | 659 // selected WebContents's RenderWidgetHostView and tell it to deactivate. |
660 if (WebContents* contents = | 660 if (WebContents* contents = |
661 browser_->tab_strip_model()->GetActiveWebContents()) { | 661 browser_->tab_strip_model()->GetActiveWebContents()) { |
662 | 662 |
663 DevToolsWindow* devtoolsWindow = | 663 DevToolsWindow* devtoolsWindow = |
664 DevToolsWindow::GetDockedInstanceForInspectedTab(contents); | 664 DevToolsWindow::GetDockedInstanceForInspectedTab(contents); |
665 if (devtoolsWindow) { | 665 if (devtoolsWindow) { |
666 RenderWidgetHostView* devtoolsView = | 666 RenderWidgetHostView* devtoolsView = |
667 devtoolsWindow->web_contents()->GetRenderWidgetHostView(); | 667 devtoolsWindow->web_contents()->GetRenderWidgetHostView(); |
668 if (devtoolsView->HasFocus()) { | 668 if (devtoolsView && devtoolsView->HasFocus()) { |
669 devtoolsView->SetActive(false); | 669 devtoolsView->SetActive(false); |
670 return; | 670 return; |
671 } | 671 } |
672 } | 672 } |
673 | 673 |
674 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView()) | 674 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView()) |
675 rwhv->SetActive(false); | 675 rwhv->SetActive(false); |
676 } | 676 } |
677 } | 677 } |
678 | 678 |
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 | 2228 |
2229 - (BOOL)supportsBookmarkBar { | 2229 - (BOOL)supportsBookmarkBar { |
2230 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2230 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2231 } | 2231 } |
2232 | 2232 |
2233 - (BOOL)isTabbedWindow { | 2233 - (BOOL)isTabbedWindow { |
2234 return browser_->is_type_tabbed(); | 2234 return browser_->is_type_tabbed(); |
2235 } | 2235 } |
2236 | 2236 |
2237 @end // @implementation BrowserWindowController(WindowType) | 2237 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |