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

Side by Side Diff: content/shell/shell.cc

Issue 8052004: Set focus to content area after navigating so that it has focus (matches what chrome does). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 2 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 | « no previous file | no next file » | 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) 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 "content/shell/shell.h" 5 #include "content/shell/shell.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "content/browser/tab_contents/navigation_controller.h" 10 #include "content/browser/tab_contents/navigation_controller.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 shell->LoadURL(url); 74 shell->LoadURL(url);
75 return shell; 75 return shell;
76 } 76 }
77 77
78 void Shell::LoadURL(const GURL& url) { 78 void Shell::LoadURL(const GURL& url) {
79 tab_contents_->controller().LoadURL( 79 tab_contents_->controller().LoadURL(
80 url, 80 url,
81 GURL(), 81 GURL(),
82 PageTransition::TYPED, 82 PageTransition::TYPED,
83 std::string()); 83 std::string());
84 tab_contents_->Focus();
84 } 85 }
85 86
86 void Shell::GoBackOrForward(int offset) { 87 void Shell::GoBackOrForward(int offset) {
87 tab_contents_->controller().GoToOffset(offset); 88 tab_contents_->controller().GoToOffset(offset);
89 tab_contents_->Focus();
88 } 90 }
89 91
90 void Shell::Reload() { 92 void Shell::Reload() {
91 tab_contents_->controller().Reload(false); 93 tab_contents_->controller().Reload(false);
94 tab_contents_->Focus();
92 } 95 }
93 96
94 void Shell::Stop() { 97 void Shell::Stop() {
95 tab_contents_->Stop(); 98 tab_contents_->Stop();
99 tab_contents_->Focus();
96 } 100 }
97 101
98 void Shell::UpdateNavigationControls() { 102 void Shell::UpdateNavigationControls() {
99 int current_index = tab_contents_->controller().GetCurrentEntryIndex(); 103 int current_index = tab_contents_->controller().GetCurrentEntryIndex();
100 int max_index = tab_contents_->controller().entry_count() - 1; 104 int max_index = tab_contents_->controller().entry_count() - 1;
101 105
102 PlatformEnableUIControl(BACK_BUTTON, current_index > 0); 106 PlatformEnableUIControl(BACK_BUTTON, current_index > 0);
103 PlatformEnableUIControl(FORWARD_BUTTON, current_index < max_index); 107 PlatformEnableUIControl(FORWARD_BUTTON, current_index < max_index);
104 PlatformEnableUIControl(STOP_BUTTON, tab_contents_->IsLoading()); 108 PlatformEnableUIControl(STOP_BUTTON, tab_contents_->IsLoading());
105 } 109 }
(...skipping 11 matching lines...) Expand all
117 void Shell::DidNavigateMainFramePostCommit(TabContents* tab) { 121 void Shell::DidNavigateMainFramePostCommit(TabContents* tab) {
118 PlatformSetAddressBarURL(tab->GetURL()); 122 PlatformSetAddressBarURL(tab->GetURL());
119 } 123 }
120 124
121 void Shell::UpdatePreferredSize(TabContents* source, 125 void Shell::UpdatePreferredSize(TabContents* source,
122 const gfx::Size& pref_size) { 126 const gfx::Size& pref_size) {
123 PlatformSizeTo(pref_size.width(), pref_size.height()); 127 PlatformSizeTo(pref_size.width(), pref_size.height());
124 } 128 }
125 129
126 } // namespace content 130 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698