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

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

Issue 3060045: Making window.focus() work in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « chrome/browser/browser.h ('k') | chrome/browser/browser_window.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 } 2729 }
2730 2730
2731 bool Browser::TakeFocus(bool reverse) { 2731 bool Browser::TakeFocus(bool reverse) {
2732 NotificationService::current()->Notify( 2732 NotificationService::current()->Notify(
2733 NotificationType::FOCUS_RETURNED_TO_BROWSER, 2733 NotificationType::FOCUS_RETURNED_TO_BROWSER,
2734 Source<Browser>(this), 2734 Source<Browser>(this),
2735 NotificationService::NoDetails()); 2735 NotificationService::NoDetails());
2736 return false; 2736 return false;
2737 } 2737 }
2738 2738
2739 void Browser::Activate() {
2740 window_->Activate();
2741 }
2742
2743 void Browser::Deactivate() {
2744 window_->Deactivate();
2745 }
2746
2739 bool Browser::IsApplication() const { 2747 bool Browser::IsApplication() const {
2740 return (type_ & TYPE_APP) != 0; 2748 return (type_ & TYPE_APP) != 0;
2741 } 2749 }
2742 2750
2743 void Browser::ConvertContentsToApplication(TabContents* contents) { 2751 void Browser::ConvertContentsToApplication(TabContents* contents) {
2744 const GURL& url = contents->controller().GetActiveEntry()->url(); 2752 const GURL& url = contents->controller().GetActiveEntry()->url();
2745 std::wstring app_name = web_app::GenerateApplicationNameFromURL(url); 2753 std::wstring app_name = web_app::GenerateApplicationNameFromURL(url);
2746 RegisterAppPrefs(app_name); 2754 RegisterAppPrefs(app_name);
2747 2755
2748 DetachContents(contents); 2756 DetachContents(contents);
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
4074 } 4082 }
4075 4083
4076 bool Browser::IsPinned(TabContents* source) { 4084 bool Browser::IsPinned(TabContents* source) {
4077 int index = tabstrip_model_.GetIndexOfTabContents(source); 4085 int index = tabstrip_model_.GetIndexOfTabContents(source);
4078 if (index == TabStripModel::kNoTab) { 4086 if (index == TabStripModel::kNoTab) {
4079 NOTREACHED() << "IsPinned called for tab not in our strip"; 4087 NOTREACHED() << "IsPinned called for tab not in our strip";
4080 return false; 4088 return false;
4081 } 4089 }
4082 return tabstrip_model_.IsTabPinned(index); 4090 return tabstrip_model_.IsTabPinned(index);
4083 } 4091 }
OLDNEW
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698